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
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

Characteristics of suspend process Suspended process isn't immediately available for execution. The process may or may not be waiting on an event. For preventing t

Virtual File System serves two important functions. 1. It divides file-system-generic operations from their execution by defining a clean VFS interface. 2. The VFS is based

Define a public key encryption system Allows just the correct receiver to decode the data


how to move the system app to usb storage

Explain in detail about ipc in linux

Define Properties to Ensure Good Search Performance A hashing function h should possess the subsequent properties to make sure good search performance: a. The hashing functi

Explain in detail about ipc in linux

Explain Swapping Swapping is a method of temporarily removing inactive programs from the memory of computer system.