论文部分内容阅读
尽管用锁变量、TS指令等方法可以实现进程之间的互斥,但这几种方法都有违背进程互斥访问临界区的条件,均存在影响系统可靠性和执行效率的问题。例如,循环测试锁定位将损耗较多的CPU计算时间,违背进程访问临界区条件:等待临界区时,释放CPU。如果并发进程数较多,且由于每个进程在申请进入临界区时都得对锁定位进行测试,这种开销是很大的。用P、V原语不但可以更好地解决进程管理中的互斥问题,而且我们还可以利用此方法解决进程同步与进程通信的问题。
Although the use of lock variables, TS instructions and other methods can be achieved between the process of mutual exclusion, but these methods have violated the process of mutually exclusive access to critical conditions, there are problems affecting system reliability and execution efficiency. For example, the loop test lock bit will consume more CPU time, violating the process access critical section conditions: release the CPU while waiting for the critical section. If the number of concurrent processes is large, and because each process has to test the lock bit when applying for a critical section, this overhead is significant. P, V primitives not only can better solve the problem of mutual exclusion in process management, but also we can use this method to solve the problem of process synchronization and process communication.