(Fwd:) [ebo@leml.la.asu.edu: wierd timing...]
Gontran Zepeda
plug-devel@lists.PLUG.phoenix.az.us
Mon May 13 13:40:38 2002
----- Forwarded message from "John (EBo) David" <ebo@leml.la.asu.edu> -----
Date: Mon, 13 May 2002 02:39:27 -0700
To: "plug-discuss@lists.PLUG.phoenix.az.us" <plug-discuss@lists.PLUG.phoenix.az.us>
X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.7-10smp i686)
Reply-To: plug-discuss@pluglist.mybutt.net
From: "John (EBo) David" <ebo@leml.la.asu.edu>
Subject: wierd timing...
Using a trick I learned years ago I was using select to "wait" for some
number of microseconds... Using it for a new program I noticed some
weird timing. After reading the man pages I found:
On Linux, timeout is modified to reflect the amount of
time not slept; most other implementations do not do this.
This causes problems both when Linux code which reads
timeout is ported to other operating systems, and when
code is ported to Linux that reuses a struct timeval for
multiple selects in a loop without reinitializing it.
Consider timeout to be undefined after select returns.
Cruising the code I found (in linux/personality.h) that one can set
"STICKY_TIMEOUTS" and force the behavior back to other definitions.
Question is, how to select to sticky. As a note I also found that
pselect is not found in the standard headers even though it is defined
in the man pages and is part of the IEEE Std 1003.1g-2000 (POSIX.1g).
so my questions are:
1) does anyone know how to set select for sticky timeouts, and/or
2) does anyone have some sample code for suspending a process for less
than a millisecond?
EBo --
----- End forwarded message -----