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

Differences between hard real-time, soft real-time, and firm real-time?

Hard Real-Time The hard real-time definition considers any missed deadline to be a system failure. This scheduling is used extensively in mission critical systems where failure to conform to timing constraints results in a loss of life or property. Examples: Air France Flight 447 crashed into the ocean after a sensor malfunction caused a series … Read more