Advertisement

linux Sleep

Started by August 30, 2007 12:34 PM
1 comment, last by Wolfdog 17 years, 5 months ago
There are a few places that I want to cause a thread to give up its quantum. This is cross-platform so in Windows I am using Sleep, in linux I want to use usleep but cannot find any resources to confirm that this will switch executing threads or will just busy-wait. All I seem to get from the man page is that it will wait for at least the given time, and perhaps more.
Might pthread_yield be suitable?
Advertisement
Quote: Original post by Null and Void
Might pthread_yield be suitable?
Yes Sir! Much better solution, thank you.

This topic is closed to new replies.

Advertisement