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
whats the use of using ipc


Multi-level page tables are tree-like structures to hold page tables. As an example, consider a two- level page table, again on a 32-bit architecture with 212 = 4 kbyte pages. Now,

Garbage collectors trade space for time. If we collect all the time (which requires a lot of processing time), the GC allocator will use the least memory possible. On the other han

Multiprocessing - An Operating System proficient of utilizing and supporting more than one computer processor. Below are some instances of multiprocessing Operating Systems. Li

Define dynamic loading. To obtain better memory-space utilization dynamic loading is used. With dynamic loading, a routine is not loaded until it is called. All routines are ke

Direct communication With direct communication each process that requires to communicate must explicitly name the recipient or sender of the communication. The send and receive

Q. The term "fast wide SCSI-II" signifies a SCSI bus that operates at a data rate of 20 megabytes per second when it moves a packet of bytes among the host and a device. Presume t

System Service Program system service program Supports and provides the services for other program. System service program perform Varity of tasks.  They are further divided in

Question: (a) (i) What is a microkernel? Describe the benefits of using microkernels. (ii) How does a microkernel-based operating system differ from a traditional operating