Skip to content

Latest commit

 

History

History
172 lines (102 loc) · 7.36 KB

File metadata and controls

172 lines (102 loc) · 7.36 KB

Concurrency and parallelism

Table of contents


Introduction and overview

🔗


GPU computing

🎥

Multithreading

🎥

📖

📄

Concurrency and the standard library

🔗

std::atomic_shared_ptr

🔗

std::condition_variable

The std::condition_variable is a synchronization primitive that can be used to block a thread, or multiple threads at the same time, until another thread both modifies a shared variable (the condition), and notifies the std::condition_variable.

📝

  • Even if the shared variable is atomic, it must be modified under the mutex in order to correctly publish the modification to the waiting thread.

🔗

std::promise

The std::promise provides a facility to store a value or an exception that is later acquired asynchronously via a std::future object created by the std::promise object.

🔗

Data races and race conditions

🔗

Lock-based

Spin locks

📝

  • Spin locks are typically slower if the number of threads is larger than the number of cores.

🔗

Lock-free

Lock-free programming is a set of techniques for writing concurrent programs without using explicit locks.

🎥

Hazard pointers

🔗

Read-copy-update (RCU)

🔗

🎥

Memory model

🔗

POSIX threads

🔗