SYSC-3303-06-Thread_Synch_Notify_Ex.5a

SYSC-3303-06-Thread_Synch_Notify_Ex.5a - SYSC 3303...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
SYSC 3303 - Synchronizing Java Threads: notify() vs notifyAll() 1 SYSC 3303 Real-Time Concurrent Systems Synchronizing Java Threads: notify() vs. notifyAll() Example Copyright © 2003 D.L. Bailey and 2007 L.S.Marshall, Systems and Computer Engineering, Carleton University revised July 9 th , 2007
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SYSC 3303 - Synchronizing Java Threads: notify() vs notifyAll() 2 Producer/Consumer Execution using notify() instead of notifyAll() • Suppose the Box is empty, and consumer threads c1 and c2 invoke get()
Background image of page 2
SYSC 3303 - Synchronizing Java Threads: notify() vs notifyAll() 3 Producer/Consumer Execution using notify() c1 gets the lock c1 box Threads in the object's wait set Threads waiting for the object’s lock
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SYSC 3303 - Synchronizing Java Threads: notify() vs notifyAll() 4 Producer/Consumer Execution using notify() c2 arrives while c1 has the lock, so c2 blocks c1 box c2
Background image of page 4
SYSC 3303 - Synchronizing Java Threads: notify() vs notifyAll() 5 Producer/Consumer Execution using notify() c1 starts executing get() c1 box c2
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/16/2009 for the course SYSC 3303 taught by Professor Shramp during the Spring '09 term at Carleton CA.

Page1 / 18

SYSC-3303-06-Thread_Synch_Notify_Ex.5a - SYSC 3303...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online