Lecture 8 - Concurrency and Synchronisation 2 Flashcards
What is a bounded buffer often a source of synchronisation problems?
Multiple producers and consumers trying to access at the same time
What is a monitor?
Programming language construct that supports controlled access to shared data
A class in which every method automatically acquires lock on entry and releases on exit
combines shared data structures, procedures that operate on them and synchronisation of the concurrent threads that invoke those procedures
What is a condition variable?
What are the operations on condition variables?
A variable that the Monitor contains and checks to determine when running whether it should remain locked
wait(c) - release monitor lock, wait for somebody else to signal condition
signal(c) - wake up at most one waiting thread
broadcast(c) - wake up all waiting threads
What is synchronization?
Moderating access to shared objects to ensure at most one thing is modifying it, and giving the ability to wait until some condition is true