What is spin lock?

What is spin lock?

- In a loop a thread waits simply ('spins') checks repeatedly until the lock becomes available.

- This type of lock is a spin lock. The lock is a kind of busy waiting, as the threads remains active by not performing a useful task.

- The spin locks are to release explicitly, although some locks are released automatically when the tread blocks.

- They are efficient as they are blocked only for a short periods.

- They can be wasteful if they are held for a longer duration.

- By implementing the spin locks correctly as they offer challenges as the programmers must take into account the possibility of simultaneous access to the lock, which could cause race conditions.
What is an operating system? Functions of an operating system - operating system
An operating system is an interface between hardware and software. OS is responsible for managing and co-ordinating the activities of a computer system.......
What is paging? Why paging is used? - operating system
OS performs an operation for storing and retrieving data from secondary storage devices for use in main memory........
Difference between a process and a program - operating system
A program is a set of instructions that are to perform a designated task, where as the process is an operation........
Post your comment