Anthony is one of the world key experts on this topic, and this chapter would not have been possible
without him. Besides a preview of his book, he provided a first implementation of the standard
concurrency library (see [JustThread]), wrote several articles, and gave valuable feedback, which all
helped me to present this topic in what, hopefully, is a useful way. But in addition, I’d like to thank
a few other concurrency experts who helped me to write this chapter: Hans Boehm, Scott Meyers,
Bartosz Milewski, Lawrence Crowl, and Peter Sommerlad.
The chapter is organized as follows:
• First, I introduce various ways to start multiple threads. After both the high-level and the lowlevel
interfaces are introduced, details of starting a thread are presented.
• Section 18.4, page 982, offers a detailed discussion of the problem of synchronizing threads. The
main problem is concurrent data access.
• Finally, various features to synchronize threads and concurrent data access are discussed:
– Mutexes and locks (see Section 18.5, page 989), including call_once() (see Section 18.5.3,
page 1000)
– Condition variables (see Section 18.6, page 1003)
– Atomics (see Section 18.7, page 1012)
18.1
Anthony is one of the world key experts on this topic, and this chapter would not have been possible
without him. Besides a preview of his book, he provided a first implementation of the standard
concurrency library (see [JustThread]), wrote several articles, and gave valuable feedback, which all
helped me to present this topic in what, hopefully, is a useful way. But in addition, I’d like to thank
a few other concurrency experts who helped me to write this chapter: Hans Boehm, Scott Meyers,
Bartosz Milewski, Lawrence Crowl, and Peter Sommerlad.
The chapter is organized as follows:
• First, I introduce various ways to start multiple threads. After both the high-level and the lowlevel
interfaces are introduced, details of starting a thread are presented.
• Section 18.4, page 982, offers a detailed discussion of the problem of synchronizing threads. The
main problem is concurrent data access.
• Finally, various features to synchronize threads and concurrent data access are discussed:
– Mutexes and locks (see Section 18.5, page 989), including call_once() (see Section 18.5.3,
page 1000)
– Condition variables (see Section 18.6, page 1003)
– Atomics (see Section 18.7, page 1012)
18.1
การแปล กรุณารอสักครู่..