O'Reilly logo

Shared Memory Application Programming by Victor Alessandrini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6

Event Synchronization

Abstract

This chapter is concerned with event synchronization, namely, how to force a thread to wait for an event triggered by another thread. A detailed pedagogical discussion of the event synchronization primitives in Pthreads, Windows, and C++11 is presented, underlining their common structure. The role of condition variables as communication agents between threads is discussed in detail. A couple of examples dealing with high-level synchronization constructs demonstrate some subtle aspects of their operation. Then, some additional event synchronization constructs—futures and promises—introduced in the C++11 thread library are reviewed, because they constitute powerful and easy-to-use tools for application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required