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 an operating system and what are the different types of operating systems? Operating System An Operating System or OS is a software program that allows the compute


What are the various process scheduling concepts? a) Scheduling queues with diagram b) Queuing diagram c) Schedulers d) Context switch with diagram

Question 1: (a) Describe what is meant by Client-server Computing? (b) Distinguish between a server process and a client process. (c) What are the basic characteristics o

Explain a boot control block A boot control block can have the information required by the system to boot an operating from that partition. If the disk does not have an operati

Define Coding in an independent service architecture Coding in an independent service architecture alleviates many of the traditional dependencies of monolithic applications.

KERNEL ACTIVITY FOR ULTS: The kernel isn't aware of thread activity but it is still managing process activity. When a thread compose a system call the whole process will be bl

Do ratio analysis by comparing the four companies financial statements, analysis and interpretation on the four-basic group : (Refer to attachment A) Liquidity ratio Asset

Process states in Linux OS Running:  Process is either ready to run or running Interruptible:  a Blocked part of a process and waiting for a signal or an event from anothe

Explain Components of conflict phase of dispatch latency The conflict phase of dispatch latency has two components 1. Preemption of any process running in the kernel. 2.