Homework - 4 Version 0 |
|
👤 Author: by 244045932qqcom 2019-10-18 02:41:20 |
Possible case about process synchronization:
Suppose two process need a same resource and one of the process requires the result produced from the other process's execution. If the one requires the other process to execute had run first, it will remain waiting.
Solution:
Assume that process p1 and p2 need the same resource and p1 requires p2's result for execution.
By maintaining an array storing infomation of processes's running result, for example (processID, result_info) for each element where result_info is 0/1/-1 representing not yet run/succeed/failed, this problem can by solve by letting p1 read such array first.