what is the difference between semaphore, mutex &
spinlock?????
Answer / guest
Kernel Locking Techniques
Semaphores in Linux are sleeping locks. Because they cause a
task to sleep on contention, instead of spin, they are used
in situations where the lock-held time may be long.
Conversely, since they have the overhead of putting a task
to sleep and subsequently waking it up, they should not be
used where the lock-held time is short. Since they sleep,
however, they can be used to synchronize user contexts
whereas spinlocks cannot. In other words, it is safe to
block while holding a semaphore.
A "mutex" (or "mutual exclusion lock") is a signal that two
or more asynchronous processes can use to reserve a shared
resource for exclusive use. The first process that obtains
ownership of the "mutex" also obtains ownership of the
shared resource. Other processes must wait for for the first
process to release it's ownership of the "mutex" before they
may attempt to obtain it.
The most common locking primitive in the kernel is the
spinlock. The spinlock is a very simple single-holder lock.
If a process attempts to acquire a spinlock and it is
unavailable, the process will keep trying (spinning) until
it can acquire the lock. This simplicity creates a small and
fast lock.
| Is This Answer Correct ? | 64 Yes | 7 No |
As a system admin i want to know some things what are the troubleshooting issues we are facing frequently and what are the tickets will be raised.
In how many ways linux can be installed n explain th steps involved in installation in any of the method..?
What file should you examine to determine the defined runlevels for your system?
plz mention some interesting problems you faced and how you solved it?
Tell me command which is use for create quota database in Linux.
why /etc/shadow file do not have any permission ?
what is kernel panic error ? how will you fix it if you have face it after rebooting without the the help of rescue disk ?
You want to create a compressed backup of the users' home directories. What utility should you use?
Through ssh whole directory structure from / is shared regardless the user we have connected with ....... how do i prevent sharing ??
How does the boot process[init levels] work on Linux? How is it different from Solaris?
how to install linux OS? pls send step by step
what is difference between TFTP abd FTP?