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

The idea of reference counting is to maintain, for every object, the total number of references to that object, i.e. the number of "incoming" pointers. Whenever the number of refer

How exactly is a page table used to look up an address? The CPU has a page table base register (PTBR)which points to the base (entry 0) of the level-0 page table. Each process h

Why Global variables are unacceptable Global variable, for instance, are unacceptable because they break the rules of self - containment. If all procedural components are runni

Question: a) What special measures must be taken to ensure the reliability, availability, and security of electronic commerce and digital business process? b) What are the c

Q. The Sun Ultra SPARC processor has numerous register sets that describe the actions of a context switch if the new context is previously loaded into one of the register sets. Wha

Sir i want formulas in Memory management starting from paging till the demang paging in a easy manner for solving problems in competitive exams

Determine the syntax of the assembler directive EQU The following is syntax of the assembler directive EQU: EQU

Briefly discuss on real-time scheduling? It is divided into two types.  Hard real-time systems are needed to complete a critical task within a guaranteed amount of time. T

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