Multithreading

Goals

  • First and foremost: learn what a race condition is

  • Learn how to avoid race conditions

    • (Binary) semaphore, as done on most bare metal OSen

    • Mutex and its several Linux flavors (recursive, for example)

  • Learn how to communicate

    • Counting semaphore

    • Condition variable

cluster_ecproposal Graph cluster_ecproposal_ec1 Embedded Computing 1 cluster_ecproposal_ec1_cxx C++ cluster_ecproposal_ec1_mt Multithreading ecproposal_ec1_cxx_build C++: Building with CMake ecproposal_ec1_mt_wait Communication: Waiting for Something ecproposal_ec1_mt_lock Avoiding Race Conditions: Semaphore/Mutex ecproposal_ec1_mt_wait->ecproposal_ec1_mt_lock ecproposal_ec1_mt_exercise_mt_race EX: Race Conditions ecproposal_ec1_mt_exercise_mt_race->ecproposal_ec1_cxx_build ecproposal_ec1_mt_exercise_mt_race_fixed EX: Avoiding Race Condition ecproposal_ec1_mt_exercise_mt_race_fixed->ecproposal_ec1_mt_exercise_mt_race ecproposal_ec1_mt_exercise_mt_race_fixed->ecproposal_ec1_mt_lock ecproposal_ec1_mt_lock->ecproposal_ec1_mt_exercise_mt_race