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
What are a safe state and an unsafe state? Answer:  A state is safe if the system can allocate resources to every process in some order and still avoid a deadlock. A system is

General graph directory The serious problem with using an acyclic-graph structure is ensuring that there are no cycles. When we insert links to an existing tree-structured dire

Device Drivers Communicates straight with peripheral devices (disks, tapes, etc.). Responsible for begin physical I/O operations on the device. Pro

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

Define busy waiting and spinlock. When a process is in its significant section, any other process that tries to enter its critical section must loop continuously in the entry c

What is paging? Name the different paging techniques. Paging is a memory management method that permits the physical-address space of a process to be noncontiguous. Paging evad

when demand is 24000 units/year, production rate is 48000 units/year, setup cost is rs 200 per setup, carring cost is rs 20 per units/year, and economic batch quantity is 692.8203

Explain about threading issues? The fork and exec system calls In a multithreaded program of few UNIX systems have chosen to have two versions of fork, one that duplicates e

In which page replacement policy Balady’s anomaly occurs? FIFO (First in First Out)

What lead to the concept of paging? The main memory is separated into two parts that are one for the resident operating system, and one for the user processes. We may perhaps p