C++ Language/Std/Multithreading

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Traditionally, we think of the flow of execution through a program as being in one place at a time, flowing from one statement to the next. But it is possible for a C++ program to have multiple "threads" of execution. Each thread would act like a traditional flow of execution. Having multiple threads causes the computation of different parts of your software at essentially the same time. Each thread maintains its own local state for things like its stack of function calls.

  1. Thread Creation
  2. Critical Section
  3. Atomic Values
  4. Locks
  5. Events
  6. Return Value
  7. Semaphores
  8. Monitors and Channels