Professional Documents
Culture Documents
Chapter 3 Problems
Chapter 3 Problems
PROBLEM 1
List 5 real applications (you haved used) that use IPC
PROBLEM 2
List 5 applications / situations in real worlds that need synchornization
PROBLEM 3
List 5 applications / situations in real worlds that need synchornization
PROBLEM 4
For all the classical synchronization problems, run step by step a certain sequence of instructions among
the processes. Update the state of the used semaphores, and prove such sequence meets all the
requirements of the synchronization constraints.
PROBLEM 5: BARRIER
Barrier is a synchronization problem with the following constraints:
+ We have N processes
+ We need a point at which all the processes MUST reach in order to continue next instructions
+ Figure b) 3 processes reach the barrier, they MUST wait for process C which hasn’t reached the barrier
+ Figure c) when all the processes reach the barrier, all of them can proceed with their next instructions
Use the semaphore to solve this synchronization problem. Write the program is pseudo-code like those
in the slides Hint: used counting semaphore.
(Ví dụ trong thực tế, chuyến xe bus chở khách du lịch đi về, cần phải đảm bảo mọi người lên xe thì xe
mới khởi hành đi về được)
PROBLEM 7: CROSSROAD
This is a real-word problem: crossroad is a place where two roads meet and cross each other
2
3