Re: [boost] [thread] monotonic xtime

-----Original Message----- [mailto:boost-bounces@lists.boost.org]On Behalf Of Olaf van der Spek On 4/10/06, Matt Doyle <mdoyle@a-m-c.com> 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? If you're waiting for another thread to do something I'd agree. What I run into all the time though is that I want to poll a device every so often so I want to surrender my thread for x amount of time.
Scanned by McAfee GroupShield {X3BTB534}
participants (1)
-
Matt Doyle