What are trade offs for “busy wait” vs “sleep”?
Going to sleep until the scheduler wakes you is the normal/prefered thing to do. Spinning (the alternative way to wait, without sleeping) is less usual and has the following effects: Keeps the CPU busy, and prevents other threads from using the CPU (until/unless the spinning thread finishes its timeslice and is prempted) Can stop spinning … Read more