...

/

Using Queues: Sleeping Instead of Spinning

Using Queues: Sleeping Instead of Spinning

This lesson discusses the use of queues to built more efficient locks.

We'll cover the following...

The real problem with the previous approaches is that they leave too much to chance. The scheduler determines which thread runs next; if the scheduler makes a bad choice, a thread runs that must either spin waiting for the lock (our first approach) or yield the CPU immediately (our second approach). Either way, there is ...

Access this course and 1400+ top-rated courses and projects.