Blocking locks, Operating System

Assignment Help:

We have talked about blocking locks, which voluntarily yield, and spinlocks, which just spin until they acquire the lock. At ?rst, it seems like spinlocks are verywasteful, and that one should always use blocking locks. But this question is a bit more complicated than that. In well-written code, locks are only held around small pieces of code, so they should not be held for very long. On a multi-processor system, it often makes sense to use spinlocks, since the thread holding the lock will likely release the lock soon, and may be running simultaneously on another processor, about to release the lock.

This question is further complicated, however, by the possibility of pagefaults (see virtual mem- ory, later in this course). Pagefaults or similar hard-to-predict delays couldmake evenwell-written multi-threaded code hold locks for longer than anticipated. A hybrid type of lock, called spin-then-yield locks, will spin for some amount of time, and if it still hasn't acquired the lock, yield. A spin-then-yield lock can be adaptive in the amount of time it spins before yielding.


Related Discussions:- Blocking locks

Explain the resource ownership by platform, Explain the Resource Ownership ...

Explain the Resource Ownership by Platform Ownership of data items may further be complicated by concepts defined in certain operating systems. Each operating system defines "p

Structures for a file''s data, Q. Likewise some systems support many types ...

Q. Likewise some systems support many types of structures for a file's data while others simply support a stream of bytes. What are the merits in addition to demerits? Answer:

How can an index file be used to speed up, How can an index file be used to...

How can an index file be used to speed up the access in direct-access files? Have an index in memory; the index gives the key and the disk location of its corresponding record.

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

Unix script, As a group, you may need to make some enhancements to your dev...

As a group, you may need to make some enhancements to your development server (NOT your stable server!)  It needs to be able to run the makepasswd program, which may require instal

How is it different from the unbounded buffer algori, How is it different f...

How is it different from the unbounded buffer algorithm ? Explain.

Kernel mode and user mode function, Q. How does the distinction among kerne...

Q. How does the distinction among kernel mode and user mode function as a rudimentary form of protection (security) system? Answer: The distinction among kernel mode and user m

Galvin, difference between process and thread

difference between process and thread

Dual Mode Operation, I am not getting what you have tried to describe here....

I am not getting what you have tried to describe here. Can you elaborate more about this, i will be thankful to you. Vinay

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