Some computers provide an indivisible machine-instruction test and set (TS) that can be used for synchronization purposes. Let X and Y be two variables. The execution of the instruction TS (X, Y) copies the value of Y into X and sets Y to false. A set of concurrent processes that must execute some instructions in mutual exclusion can use a global variable PERMIT, initialized to true, and a local variable X in the following way: repeat TS (X, PERMIT) until X; instructions to be executed in mutual exclusion; PERMIT:= true • In this case, processes do not suspend themselves; they are always executing (this is called busy waiting). Compare this solution to one based on semaphores in which P and V are implemented by the kernel. • Describe how to implement P and V on semaphores by using the test and set primitive in a busy wait scheme.
The post Describe how to implement P and V on semaphores by using the test and set primitive in a busy wait scheme. appeared first on Dissertation Help Service.