Introduction
Multithreading can be your biggest problem if you cannot handle it with care. One of the fathers of the Delphi compiler used to say:
"New programmers are drawn to multithreading like moths to flame, with similar results." | ||
--– Danny Thorpe |
In this chapter, we will discuss some of the main techniques to handle single or multiple background threads. We'll talk about shared resource synchronization and thread-safe queues and events. The last three recipes will talk about the Parallel Programming Library introduced in Delphi XE7, and I hope that you will love it as much as I love it. Multithreaded programming is a huge topic. So, after reading this chapter, although you will not become a master of it, you will surely be able to approach the concept of multithreaded programming with confidence and will have the basics to jump on to more specific stuff when (and if) you require them.