进程同步相关术语解释
Race Condition: A situation where
1. serveral processes access and manipulate the same data concurrently
2.the outcome of the execution depends on the particular order in which the access takes place
Critical Section: a segment of code
If process p1 is executing in its critical section, then no other processes can be executing in their critical sections
Semaphore: a syncrhonization tool
A semaphore contains an integer variable is accessed only through two standard operations: acquire() and release()
Semaphore sem = new Semaphore(1); sem.acquire(); //critical section sem.release(); //remainder section