Describe how to implement p and v on semaphores by using


Problem

Some computers provide an indivisible machine-instruction test and set (TS) that can be used for synchronization purposes. Let X and Y be two boolean 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 boolean variable PERMIT, initialized to true, and a local boolean 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.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Describe how to implement p and v on semaphores by using
Reference No:- TGS02680037

Expected delivery within 24 Hours