2016329621033 homework4 Version 0 |
|
👤 Author: by 1091959239qqcom 2019-12-11 10:12:58 |
Producer-consumer issues;Reader-Writer Problem;
1.Signal and PV Operation:The main idea of this mechanism is that by quantifying resources, the action of applying for and releasing resources can be concretized, so as to achieve the degree of visualization of the operation and results of resources.
2.Conditional critical zone:From the previous article, we can see that PV operation is more flexible, ordinary PV operation is not feasible, to strengthen the use of continued, but if one step forgot PV operation, it will cause deadlock problems.
But generally speaking, the general synchronization problem can be solved, that is, the mechanism is relatively low-level. So somebody put forward a higher conditional critical zone.
3.Pipeline
PV operation is not only a low-level, but also a decentralized synchronization mechanism. That is to say, the operation of shared variables and semaphore variables is dispersed in various processes, resulting in poor readability and locality of the program, which is not conducive to the modification and maintenance of the program. (If the operation is dispersed, it is necessary to read the whole program thoroughly to detect the correctness of PV operation.) In other words, correctness is difficult to guarantee. This is the case. Therefore, the concept of pipeline is proposed, which concentrates the shared variables and the operations that can be performed on the shared variables in one module.