Subj : Re: Predicate for pthread_cond_timedwait() ?? To : comp.programming.threads From : David Schwartz Date : Fri Mar 18 2005 01:05 am "Daniel Rakel" wrote in message news:pan.2005.03.18.08.26.33.925443@ID-48088.user.uni-berlin.de... > David Schwartz wrote: >> I almost forgot to tell you about 'select'. If you use 'select' with >> NULL pointers for all the fd sets, it can act as a sleep function too. In >> order of preference, here's what I suggest: > [1-4] >> 5) Use 'select'. > To simplify programming, isn't it better to always use 'select'? I don't think so. > Which > advantages have the other functions or which dsiadvantages has 'select' > over the other solutions? For one thing, the 'select' function is too heavy for this application. If 'nanosleep' is available, it's much cleaner. But the big one is that the 'select' function used to have the wrong semantics (return before timeout, not make runnable after timeout) and any system that has them right probably also has 'nanosleep'. DS .