[Monetdb-developers] usleep not portable

Stefan Manegold Stefan.Manegold at cwi.nl
Tue May 22 14:51:20 CEST 2007


FYI:

pathfinder/runtime/xrpc_server.mx introduces
#ifdef _WIN32
...
#define sleep(s) Sleep(1000*(s))
...
#endif

source//MonetDB/src/gdk/gdk_posix.mx provides
MT_sleep_ms() that uses depending on availability) nanosleep() or select()
on Unix and Sleep() on Windows.

Stefan


On Tue, May 22, 2007 at 02:34:25PM +0200, Sjoerd Mullender wrote:
> Jennie, you introduced a call to usleep in xrpc_client.mx.  How
> important is that?
> 
> The problem is, usleep is not portable.  For one, it is not a Posix call
> (use nanosleep instead), and worse (in practice), it's not available on
> Windows (but neither is nanosleep).  On Windows there is Sleep() which
> takes milliseconds as an argument (unlike sleep which takes seconds,
> usleep which takes microseconds, and nanosleep which has nanosecond
> precision).
> 
> -- 
> Sjoerd Mullender

-- 
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |




More information about the developers-list mailing list