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...

The sorting algorithm where the time complexity depends on both the range and the number of elements is:

A. quicksort B. insertion sort C. heapsort D. counting sort

Computer Science & Information Technology

Use a Web ____________________ to preview a report as a Web page.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A loop whose instructions you want processed a precise number of times is often referred to as a ____ loop.

A. conditional B. precision C. counter-controlled D. sequential

Computer Science & Information Technology

To create digital audio that a computer can play, ____ of the analog sound wave are collected at periodic intervals and stored as numeric data.

A. pitches B. samples C. bytes D. traces

Computer Science & Information Technology