On a multi-threaded Linux application I use a mutex for critical sections. This works very well except for the fairness issue. It can happen that a thread leaving a critical
If your claim holds true (I haven't got the time to read up, and it would appear as though you have researched this before posting the question), I suggest
sleep(0);
to explicitely yield in between critical sections.
while(true)
{
critsect.enter();
... do calculations ...
... maybe call a blocking operation so we sleep ...
critsect.leave();
sleep(0);
}