正在加载图片...
5.4.1 Concept of Monitors(8/10) Condition variables support three operations 1. Wait(Lock lock, Condition c): atomic (release lock go to sleep), when the process wakes up it re- acquires lock 2. Signal( Condition c): wake up waiting thread, if one exists. Otherwise, it does nothing 3. Broadcast(: wake up all waiting threads Rule: thread must hold the lock when doing condition variable operations5.4.1 Concept of Monitors(8/10) • Condition variables support three operations: • 1. Wait(Lock lock,Condition c): atomic (release lock, go to sleep), when the process wakes up it re￾acquires lock. • 2. Signal(Condition c): wake up waiting thread, if one exists. Otherwise, it does nothing. • 3. Broadcast(): wake up all waiting threads • Rule: thread must hold the lock when doing condition variable operations. 13
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有