Blocking locks, Operating System

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.

Posted Date: 3/12/2013 5:25:53 AM | Location : United States







Related Discussions:- Blocking locks, Assignment Help, Ask Question on Blocking locks, Get Answer, Expert's Help, Blocking locks Discussions

Write discussion on Blocking locks
Your posts are moderated
Related Questions
List ways to share files among directories in operating systems. a. Copy file from one account into another. b. Link directory entry of "copied" file to directory entry of o

What is process control block? Every process is represented in the OS by a process control block. It has many pieces of information associated with an exact process.

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 the function of operation management?

Define Instance. An instance is an administrative unit in which components of R/3 systems giving one or more services are grouped together.  The services offered by a case are

what is multilevel page table and its applications?

This is a group project as described in the 'AssignmentDescription.pdf' file. I am doing a sub project which is "sub project Mobile application. Android or Apple based. Turn based

In this exercise we are going to use  pthread()to simulate the dynamics between a warehouse, factory and retail. The factory produces product by using parts supplied by the warehou

Q. Presume that a scheduling algorithm at the level of short-term CPU scheduling favours those processes that have used the least processor time in the recent past. Why this algori

Smith, who is a civil engineer, purchased a 30-hectare block of land in Australia in 1986 and used two hectares of it as a main residence. The part that was not main residence cost