Docsity

Condition Variables - Advanced Unix Programming - Lecture Slides, Slides of Computer Programming

Partial preview of the text

Download Condition Variables - Advanced Unix Programming - Lecture Slides and more Slides Computer Programming in PDF only on Docsity!

Week 13 Topics

  • Threads
    • Basic thread functions
    • Some more thread functions
    • Thread-specific data
    • Mutual exclusion
    • Condition variables

Condition variables

  • Consider the producer-consumer program

in example1.c

  • One limitation with this is the polling mechanism to check the item buffer
  • It is better to use some kind of notification mechanism to reduce CPU usage - Condition variable