1. READER WRITER
Consider a bank whose accounts can be accessed and updated by any of a number of ATMs.
Each ATM could be a separate thread, responding to deposit and withdrawal requests from different users simultaneously.
Of course, it would be important to make sure that two users did not access the same account simultaneously.
2. SEQUENTIAL PROCESSES
Two threads need to send data packets over a single network connection.
Each thread must be able to send its entire data packet before the other thread starts sending its data packet; otherwise, the data is scrambled.
This scenario requires each thread to synchronize its access to the code that does the actual data-packet sending.
3. PRODUCER CONSUMER
Audio video player : Network and Display threads.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.