Advanced synchronization in operating system, Operating System

Recall that condition variables are synchronization primitives that enable threads to wait until a particular condition occurs.

Generalizing, the combination of locks and condition variables is sometimes called a monitor, which is sometimes incorporated into data structures in some languages (note that this termi- nology is not always used in a standardized way).

Previously,we discussed howto use condition variables and signals to implement a simple producer- consumer system. Looking at this system again, could we move the signal() call in enqueue() down below the unlock()?

while (queue empty)
wait(A, C)
// used to signal here, inside lock
signal(C) // now signal here, outside lock

Will this work? The answer is yes. It might not be as clean conceptually, but nothing bad will happen (verify this for yourself).

Posted Date: 3/12/2013 5:18:51 AM | Location : United States

Related Discussions:- Advanced synchronization in operating system, Assignment Help, Ask Question on Advanced synchronization in operating system, Get Answer, Expert's Help, Advanced synchronization in operating system Discussions

Write discussion on Advanced synchronization in operating system
Your posts are moderated
Related Questions
Present your own fully documented and tested programming example illustrating the prevention of a data race in a parallelised program. This is an example where total number of p

Broken data into small packets allow time division multiplexing. In TDM every packet leaves the sender and is switched on the shared interaction channel through a multiplexer. At t

Using pages makes it easier to manage the whole memory, avoiding excessive fragmentation and waste. As an analogy, think of Tetris, but with only square blocks: it is relatively ea

explain about oprating system services and topics briefly

What is indexed allocation? Every file has its own block of pointers to the sectors of the file.

What components of the R/e system initiate the start of background jobs at the specified time? The batch scheduler initiates the begin of background job.  The dispatcher then s

What are the methods for handling deadlocks ? The technique for handling the deadlocks are: We are able to use protocol to prevent or avoid the deadlock, make sure tha

what is difference between file descriptor and file pointer?

Introduction of linux