SYSC-3303-06-ConditionSynchronization

SYSC-3303-06-ConditionSynchronization - SYSC 3303 RealTime...

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

View Full Document Right Arrow Icon
SYSC 3303 Real Time Programming Condition Synchronization
Background image of page 1

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

View Full DocumentRight Arrow Icon
sk Synchronization Task Synchronization Tasks–and especially threads – usually need to cooperate with each other in order to achieve a net p goal. 1. Condition Synchronization poses order on joint execution sequence Imposes order on joint execution sequence Allows one thread to perform an operation only after another thread has performed some other operation or as reached a defined state has reached a defined state Objective: Delay a process until a condition is true 2. Mutual Exclusion Synchronization Controls access to shared resource. Objective: Ensure two processes do not interfere with each other’s use of a shared resource. 1/22/2009 SYSC 3303 Winter 2009 C. Schramm 2
Background image of page 2
ounded Buffer Problem Bounded Buffer Problem lassic Synchronization Problem Classic Synchronization Problem Producer:Consumer share a finite buffer ccommodates differing rates of produce/consume Accommodates differing rates of produce/consume Requires utex nchronization on buffer contents Mutex Synchronization on buffer contents Buffer operations are critical sections Condition Synchronization Producer must not add to full buffer Consumer must not remove from empty buffer Waiting threads must relinquish processor g q p 1/22/2009 SYSC 3303 Winter 2009 C. Schramm 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
va Condition Synchronization Java Condition Synchronization e sit stack: oundedBuffer zip Re visit stack: BoundedBuffer.zip In Class Object ait() and wait(timeout) wait() and wait(timeout) notify() and notifyAll() sed in conjunction with application’s condition Used in conjunction with application s condition variable an only be called within nchronized ethods Can only be called within
Background image of page 4
Image of page 5
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 / 15

SYSC-3303-06-ConditionSynchronization - SYSC 3303 RealTime...

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

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