I have absolutely no problem with simply putting in a sleep, your reasoning is impeccable. Using another mechanism would indeed be more work, and introduce the possibility of creating new bugs, and the savings would be minimal.
Query, if you are (or someone else is) able to answer: was this indeed the same thing causing similar problems in D3, and if so, is there no process for migrating bug fixes in code common to more than one product down to the original base code, and then back up to each product that uses it? If there is a process, did it simply fail? Or are the code bases so disparate that such a process would be impractical?
BTW, in the live version, at least some of the shared dynamically loaded libraries have developer paths stored, including the developer's name; might want to fix that if it matters.
Linean, I understand your impatience and how annoying it is. I doubt you'll get a firm answer from Blizzard, but I'd expect a patch next Tuesday (it's live on Beta/PTR right now, though).
A sleep, in this context, simply tells that thread to stop processing for a short while, say five or ten milliseconds. Since the processing probably takes a few hundred microseconds per loop, that drops it down from 100% CPU to around 3% (which is what I'm currently seeing for that thread). 3% isn't NOTHING, but it's nothing to be worried about.
Slower processors might show a higher percent, since it takes them longer to run one loop before sleeping, but it's still fine.
A cond_wait (specifically, pthread_cond_wait) is more elegant solution where the thread goes to sleep until another thread changes something that MIGHT require attention. The other thread notifies the waiting thread (our problem thread), which wakes up, checks to see if there's something to do, does it if so, and then goes back to waiting. It uses no CPU time at all unless there's potentially something to do. The "cond" part of that is "condition", i.e. wait until conditions are changed.
None of this matters to you, though. This fix (that's on PTR/Beta right now) solves the issue we've been talking about here. There may be other problems.
Edited by Growltiger on 9/6/2012 7:17 PM PDT