Busy waiting is usually the answer for stuff like this. Most practical OS schedulers are simply not fast enough to handle yielding and context switches with the necessary levels of determinism.<p>If your timings need to be accurate to the microsecond/sample level (i.e. 44.1kHz rate would be ~23uS between samples), then you probably need to go this path.