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

In an operating system, what is the difference between a system call and an interrupt?

Short Answer: They are different things. A system call is call by software running on the OS to services provided by the OS. An interrupt is usually external hardware component notifying the CPU/Microprocessor about an event that needs handling in software (usually a driver). I say usually external, because some interrupts can be raised by … Read more

Does a memory barrier ensure that the cache coherence has been completed?

The memory barriers present on the x86 architecture – but this is true in general – not only guarantee that all the previous1 loads, or stores, are completed before any subsequent load or store is executed – they also guarantee that the stores have became globally visible. By globally visible it is meant that other … Read more

Difference between load-time dynamic linking and run-time dynamic linking

load-time linking is when symbols in the library, referenced by the executable (or another library) are handled when the executable/library is loaded into memory, by the operating system. Run-time linking is when you use an API provided by the OS or through a library to load a DLL or DSO when you need it, and … Read more

Understanding load average vs. cpu usage [closed]

top shows CPU utilization for running processes while load average shows (since 1993) number of running processes plus number of processes in the uninterruptible state. Processes waiting for work do not consume CPU. As a result top CPU utilization is less that 7/8 * 100%. Source: http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html

tech