Subj : Re: How to wait on multiple condition variables or implement a similar semantics To : comp.programming.threads From : David Schwartz Date : Tue Mar 15 2005 09:07 pm "Pavel Lebedinsky" wrote in message news:1110949119.492759.194360@f14g2000cwb.googlegroups.com... > Joe Seigh wrote: >> There are emulations of the windows WaitForMultipleObjects out >> there, but they're pretty inefficient. >> So is the windows implementation but that's hidden from you. > Inefficient compared to what? Inefficient compares to not waiting for multiple objects. > If you have a bunch of objects that you want to wait for > then I would expect it to be more efficient to use > WaitForMultipleObjects rather then WaitForSingleObject > in a loop. Sure, you can often redesign things so that > you don't need multiple objects in the first place but > that's a separate issue. No, that's not a separate issue, that's his point. It's easy to say "Oh, there's this WaitForMultipleObjects function, so there's no reason for me to redesign so I don't need multiple objects". His point is that even though it's one nice neat function, it's inefficient. Your best bet is to architect so that you don't need it. You may say, "Eww, if I code my own, it will be ugly and inefficient". His point is that the version Windows gives you is ugly and inefficient, the ugliness and inefficiency is just hidden from you. DS .