Re: wait for a condition to be satisfied



From: "Helmethead" <hoshem mel comcen com au>

> > Secondly, sleep() (and usleep()) are not thread-safe, are they? is there
> > anything thread-safe as a replacement for sleep()? (I heard about
g_sleep
> > but "grep -r g_sleep /usr/include/*" gives no results)
>
> Dahm, I heard something like this but I can't remember or find anything in
the pthreads docs. I don't program in threads.. I can do a better job of
scheduling my simultaneous tasks than the linux kernel any day ;-)

for what it's worth, nanosleep() is the usual thread-safe sleep. it works a
little differently, but the
man nanosleep page should clarify it.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]