Date: Tue, 20 Apr 1999 19:00:58 -0600 From: Wes Peters <wes@softweyr.com> To: Graham Wheeler <gram@cdsec.com> Cc: hackers@FreeBSD.ORG Subject: Re: Using select() to implement a delay Message-ID: <371D234A.E5C2AD8D@softweyr.com> References: <199904201316.PAA23736@labinfo.iet.unipi.it> <371CA30F.6F84565B@cdsec.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Graham Wheeler wrote: > > Luigi Rizzo wrote: > > > > > > I have an interesting problem. I have a routine to implement delays: > > ... > > > > I am using this both because it gives better resolution than sleep(), > > > > and also because it doesn't require the use of SIGALRM, which I am > > > > using elsewhere. > > > > > > Do you have any reasons not to use usleep(3) or nanosleep(2)? > > > > portability to other unixes... > > As well as the fact that usleep uses signals. Whatever gave you that idea? From the 3.1 man page for usleep: This function is implemented using nanosleep(2) by pausing for microseconds microseconds or until a signal occurs. Consequently, in this implementation, sleeping has no effect on the state of process timers, and there is no special handling for SIGALRM. NetBSD has the same implementation, apparently. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.softweyr.com/~softweyr wes@softweyr.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?371D234A.E5C2AD8D>