Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 1999 17:53:52 +0200
From:      Graham Wheeler <gram@cdsec.com>
To:        hackers@freebsd.org
Subject:   Re: Using select() to implement a delay
Message-ID:  <371CA30F.6F84565B@cdsec.com>
References:  <199904201316.PAA23736@labinfo.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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. I am trying to avoid
using signals, as there is a Timer C++ class in the same library
which implements timeouts for system calls using SIGALRM (and a
SignalHandler class), and I want to be able to use the Timer class
in the same code as the Sleep routine should the need arise.

-- 
Dr Graham Wheeler                          E-mail: gram@cdsec.com
Citadel Data Security                      Phone:  +27(21)423-6065/6/7
Firewalls/Virtual Private Networks         Fax:    +27(21)24-3656
Internet/Intranet Network Specialists      
Data Security Products                     WWW:    http://www.cdsec.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?371CA30F.6F84565B>