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

What is sector sparing, What is sector sparing? Low-level formatting al...

What is sector sparing? Low-level formatting also sets aside extra sectors not visible to the operating system. The controller can be told to change each bad sector logically w

What is a path name, What is a path name? A pathname is the path from t...

What is a path name? A pathname is the path from the root by all subdirectories to a specified file. In a two-level directory structure a user name and a file name explain a pa

What are the drawbacks of spiral model, What are the drawbacks of spiral mo...

What are the drawbacks of spiral model? I. It is based on customer communication. If the communication is not proper then the software product that gets developed will not be t

MICROKERNEL, ADVANTAGES OF MICROFERNEL IN YSTEM DESIGN?

ADVANTAGES OF MICROFERNEL IN YSTEM DESIGN?

define system calls, When a computer is started on, the program that execu...

When a computer is started on, the program that executed first is named the ''operating system.'' It controls pretty much all applications in the computer. This adds who logs in, h

Explain process scheduling in multiprogramming, Normal 0 false ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Is anti virus a system utility, Problem: a) Explain physically what occ...

Problem: a) Explain physically what occurs when a disk is fragmented. What is the purpose of "defragmenting" a disk? b) What is the idea behind backing up data on a secondar

Explain the booting process for a windows xp system, Q. Explain the booting...

Q. Explain the booting process for a Windows XP system? Answer: (1) Since the hardware powers on the BIOS begins executing From ROMand loads as well as executes the bootstrap

We can view an operating system as a resource allocator, We can view an ope...

We can view an operating system as a resource allocator. Explain. We can outlook an operating system as a resource allocator. A computer system has Many resources (software and

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