What is the difference between semaphore and spinlock?
Answer / sandeep
Spinlock is a busy wait. Semaphore is a sleep wait.
Spinlocks are used to get exclusive access to critical
section whereas semaphores are used for exclusive access and
also to synchronize processes and threads.
Spin locks are used when the critical sections it is
protecting is small and are held for a short time.
Semaphores can be held for longer time. Semaphores use spin
locks to access its control structures.
Spinlocks are kernel locking mechanism where as semaphores
are used in both kernel and user space.
Semaphores should not be used in interrupt handlers since
the code sleeps if the semaphore is not acquired.
| Is This Answer Correct ? | 7 Yes | 0 No |
What text filter can you use to display a binary file in octal numbers?
How to sort a file of size 2N bytes, if I have N bytes of memory?
in linux gui desktop icon was lost how con u back this icons
how u use the iptable firewall to restrict ssh,telnet,ftp
what is meant by mysql clustering
How do display error messages instantly when command fails?
what is NIS Server...?
How to build new filesystem ? and what is irig file system?
i installed clustering packages.When i try to run it getting LUCI error...what is it..??
tell me some of the Linux HotKeys do you know?
what are the default permissions for files and folders..?
What is the complete name of the default configuration file for LILO?