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 is the use of fork and exec system calls? Fork is a system call by which a latest process is created. Exec is also a system call, which is used after a fork by one of the

Processes- Making the System More Responsive and Useful A method by definition build up of a code execution and resource ownership. A process has two main characteristics, code

Define a layer that is not of an IO management moduleĀ  MCS that is Management Control System is not of an IO management module

Transparency Users must be able to access remote resources as though these resources were local. Transparency should as well promote user mobility. Users must be allowed

Page fault is a trap to the software gained by the hardware when a process accesses a page that is goes in the virtual address space, but not added in physical memory. In the har

explain in detail about ipc in linux

Interrupts The hardware mechanism that enables a device to inform the CPU is called an interrupt. The basic interrupt mechanism works as follows. The CPU hardware has a wire kn

You have been requested by your Senior Engineer to design an Engine Control Unit (ECU) and prepare a report detailing your proposed solution. The client requires a design for a mic

In a table format, discuss the differences between the fixed partition and the variable partition memory organization in terms of the basic idea, memory structure, advantages

What is banker's algorithm? Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple examples of each resource type