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
In modern operating systems, applications do not directly access the physical memory. Instead, they use so-called virtual memory, where each virtual address is translated to a phys

Q. Define Input - Output operations? Serial lines, Disks, tapes and other devices should be communicated with at a very low level. The user require only specify the device and

Operating Systems 1. Illustrate the Microkernel Architecture with suitable diagram. 2. When Deadlock occurs? What are the Necessary Conditions for Deadlock? 3. Describe f

Contiguous allocation: Every file will be allocated contiguous space in the memory. Allow the block size be 1K If a 50K files desires to be allocated space after t

What is long-term, medium-term, short-term? In a batch system many processes are submitted than are able to be executed immediately. These processes are reel to a mass storage

Define deadlock. A process requests resources; if the resources are not available at that time, the process enters a wait state. Waiting processes might be never again change s

Which are the different states of a process?   Different status of a process is: New: When the process is created. Running: When instructions are executed. Wait

BEST FIT ALGORITHM Here scanning is for the finest fit one. Signifies it searches the entire list for the best fit position. For the process therefore in that the process will

List two types of system directories A) Device directory:- Describing physical properties of files. B) File directory :- Giving logical properties of the files.

Define the WindowsNT WindowsNT provides a two-level approach to resource management: process and thread. The process is the uppermost level and contains most of the application