Describe how to implement P and V on semaphores by using the test and set primitive in a busy wait scheme.

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.


 

. .

get-your-custom-paper

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.

“Get 15% discount on your first 3 orders with us”
Use the following coupon
FIRST15

Order Now