Advanced synchronization in operating system, Operating System

Assignment Help:

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).


Related Discussions:- Advanced synchronization in operating system

Explain a method for process migration, Q. Process migration in a heterogen...

Q. Process migration in a heterogeneous network is typically impossible given the differences in architectures and operating systems. Explain a method for process migration across

Android development, Developing an application for android encompass differ...

Developing an application for android encompass different steps as follows: Setup:  Development environment is prepared during this phase. This includes downloading and installi

Define process? what is meant by state of a process?, Define process? What ...

Define process? What is meant by state of a process? Process is a program in implementation. A process in general includes the process stack, which consists temporary data and

Define page stealing, Define Page stealing    Page stealing is taking ...

Define Page stealing    Page stealing is taking page frames another working sets

Factors involved in choosing the host operating system, 1. How is reliabili...

1. How is reliability enhanced with the microkernel approach to system design?  2. In a virtual machine design where guest operating systems are independent virtual machines sup

Evolution of operating system, breifly write a note on about evolution of o...

breifly write a note on about evolution of operating system?

Thread, advantages and disadvantages of kernal level thread

advantages and disadvantages of kernal level thread

Explain fixed partitioning techniques, FIXED PARTITIONING In a fixed p...

FIXED PARTITIONING In a fixed partitioning, the operating system inhabiting some fixed portion of main memory is available for use of multiple processes -Using fixed partit

Explain the novell netware, Explain the Novell NetWare     NetWare does...

Explain the Novell NetWare     NetWare doesn't really have the concept of processes in the architecture, as  the most closely associated element in the NetWare  environment to

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd