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()?

dequeue()
lock(A)
while (queue empty)
wait(A, C)
remove_item()
unlock(A)
enqueue()
lock(A)
insert_item()
// used to signal here, inside lock
unlock(A)
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
Q. What is the use of the command interpreter? Why is it generally separate from the kernel? Answer: It reads commands from the user or else from a file of commands and execu

Translation Look aside Buffer In a cached system, the base addresses of the last few indexed pages is maintained in registers named the TLB that adds in faster lookup. TLB has


What does the last four digits '0010' of the above dump represent? What action will the Destination node takes when it receives this packet? The last four digits '0010' denotes

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

what common event leads to the creation of a process?

Q. How does NTFS handle data structures? How does NTFS recover from a system crash? What is guaranteed after a recovery takes place? Answer: In NTFS all file-system data stru

Q. A CPU scheduling algorithm determined an order for the execution of its scheduled processes. Convinced n processes to be scheduled on one processor how numerous possible differ

explain about design issues of network operating system

Q. Present an algorithm for reconstructing a logical ring after a process in the ring fails? Answer: Typically distributed systems utilize a coordinator process that performs