Boost logo

Boost :

From: Olaf van der Spek (olafvdspek_at_[hidden])
Date: 2006-04-10 14:06:59


On 4/10/06, Matt Doyle <mdoyle_at_[hidden]> wrote:
> I'd like to second that request, needing to use the win32 Sleep just kills the portability. My workaround for yielding is -
>
> #if defined _MSC_VER || WIN32
> # include <windows.h> // for Sleep
> # define MILLI_SECOND_SLEEP(value) (Sleep(value))
> #else
> # include <unistd.h> // for usleep
> # define MILLI_SECOND_SLEEP(value) (usleep(value * 1000))
> #endif
>
> but that's just a hack, it really should be in the library.

Isn't yielding itself a hack?
Shouldn't thread coordination be used instead?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk