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 are the default permissions for files and folders..?
How to recover a deleted file in linux ?
How to sort a file of size 2N bytes, if I have N bytes of memory?
What is LILO?
There are 4 network Interfaces, how can we find which one is Primary.
What is Hard mount and soft Mount?
What is the difference between Telnet and SSH?
In Linux(RHEL) server have two users with same name. one is local user and second one is NIS user. if you login the server which user will login (local or NIS)
what restrict telnet for root itself but allow for other user
What is the difference between ext3 and ext4?
How find out drivers of installed devices in linux (RHEL)?
what is the difference betweenh the NFS and FTP?