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
discuss unsafe state in operating system

SSTF (Shortest Seek Time First) After a demand go to the closest request in the work queue regardless of direction Decrease total seek time compared to FCFS Disadv

Q. Under what conditions do page faults occur? Explain the actions taken by the operating system when a page fault occurs. Answer: A page fault take places when an access to

What are the deadlock p revention methodologies? a.       Necessitate that processes request all resources before starting - if cannot be granted don't run. b.      Process

Removing System Dependencies Because portions of the client - server application program may execute on different machines, it is very important for the developer to remove the

#question.explain varios types of system calls..

Briefly explain about file system implementation? Several on-disk and in-memory structures are used to execute a file system. On disk, the file system may have information abou


Define buffering. A buffer is a memory area that keeps data whereas they are transferred among two devices or among a device and an application. Buffering is done for three rea

explain about design issues of network operating system