I have always taken the approach that a tournament game never blocks anywhere. I use spin locks. When a thread had no work, it uses a spin loop waiting for a split block to join. Etc. Once you block, you open the door for arbitrarily long waits before your process is re-scheduled for execution. Of course the same problem can occur if you run more processes than cores, or if you have excessive interrupts going on to temporarily preempt a running process. I usually try to thin out the craplets that can cause problems so that I don't get preempted for any measurable amount of time...Waschbaer wrote:As far as i know, Unix, Linux and Windows are not realtime operating systems, so there is no guaranteed response time given und for this you can't call it a bug of the OS.
You, the programmer of applications has to be aware of it.
EDIT
If the heavy load of the system comes from a lot of programs/threads you are responsible for, don't let the OS choose what thread has to been stopped, do it by yourself, but then the lazy concept is looking wrong, isn't it?
If the linux kernel can spin for things it needs quickly, so can I.