busy-loop

Bogomips, threads, busy-loop, spinning and other friends

Bogomips -- unscientific measurement of CPU speed made by the Linux kernel when it boots, to calibrate an internal busy-loop.
In other words ""the number of million times per second a processor can do absolutely nothing" :)

Busy waiting or spinning is a technique in which a process repeatedly checks to see if a condition is true.

I found this script on wikipedia that implements a "busy-loop" using pthread.h.
So basically a thread is waiting for another to increment the value of an integer "i", and when this happens it prints something like "i was updated, value of i is "bla...bla".