A spin lock (see Bacon [2002]) is a boolean variable accessed via an atomic test-and-set instruction, which is used to obtain mutual exclusion. Would you use a spin lock to obtain mutual exclusion between threads on a single-processor computer?

What will be an ideal response?


The problem that might arise is the situation in which a thread spinning on a lock uses up its timeslice, when meanwhile the thread that is about to free the lock lies idle on the READY queue. We can try to avoid this problem by integrating lock management with the scheduling mechanism, but it is doubtful whether this would have any advantages over a mutual exclusion mechanism without busy-waiting.

Computer Science & Information Technology

You might also like to view...

In SharePoint, a black arrow next to an item in Tree view indicates it can be expanded

Indicate whether the statement is true or false

Computer Science & Information Technology

Can a database contain two identical records without a negative effect on the integrity of the database? Why or why not?

What will be an ideal response?

Computer Science & Information Technology