Files
ostep-code/threads-cv
2019-05-08 13:24:29 -05:00
..
2019-04-29 14:39:06 -05:00
2019-04-30 09:57:31 -05:00
2019-04-30 10:03:10 -05:00
2019-04-29 14:42:03 -05:00
2019-04-29 14:39:06 -05:00
2019-04-30 11:41:01 -05:00
2019-04-30 11:30:27 -05:00
2019-04-30 11:41:01 -05:00

Condition Variables

Code examples from condition variables chapter. Build by typing make; run the resulting executable to see how it works. Insert sleep() calls of various lengths to control timing and force bad things to happen.

Fork/Join Problem

  • join_spin.c: Working solution but wastes CPU.
  • join_no_lock.c: What happens when you don't put a lock around the state change and signal
  • join_no_state_var.c: What happens if you don't have a state variable
  • join.c: A working solution
  • join_modular.c: A modularized version

Producer/Consumer Problem

  • pc_single_cv.c: What happens if you only use one condition variable
  • pc.c: A working solution