Getting Started with the Parallel World

If you are reading this book from start to finish, without skipping chapters, you've been through quite a lot. I've discussed algorithms, optimization techniques, memory management, and more, but I've quite pointedly stayed away from parallel programming (or multithreading, as it is also called).

I had a very good reason for that. Parallel programming is hard. It doesn't matter if you are an excellent programmer. It doesn't matter how good the supporting tools are. Parallel programming gives you plenty of opportunities to introduce weird errors into the program: errors that are hard to repeat and even harder to find. That's why I wanted you to explore other options first.

If you can make your program fast enough without going the parallel way, then make it so! Classical non-parallel (single-threaded) code will always contain less bugs and hidden traps than parallel code.

Sometimes this is not possible, and you have to introduce parallel programming techniques into the code. To do it successfully, it's not enough to know how to do parallel programming. Much more important is that you know what you should absolutely never do in parallel code.

To set you in the right mood, this chapter will cover the following topics:

  • What is parallel programming and multithreading?
  • What are the most common causes of program errors in parallel code?
  • How should we handle the user interface in a parallel world?
  • What is synchronization, and why is it both good and bad?
  • What is interlocking, and when is it better than synchronization?
  • How can we remove the synchronization from the picture?
  • What communication tools does Delphi offer to a programmer?
  • What other libraries are there to help you?
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.23.59.248