for example by initializing a semaphore to 0


For example, by initializing a semaphore to 0, threads can wait for an event to occur, and impose an ordering constraint, similar to a monitor using condition variables, but with memory: semaphore sem=0; // 0==locked for a semaphore


thread A
down(sem) // wait for thread B; note sem has memory!
// do stuff
thread B
// do stuff, then wake up A
up(sem)

Request for Solution File

Ask an Expert for Answer!!
Operating System: for example by initializing a semaphore to 0
Reference No:- TGS0210306

Expected delivery within 24 Hours