Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 1996 13:16:16 -0700
From:      Darren Davis <DARREND@novell.com>
To:        brandon@novell.com
Cc:        freebsd-hackers@freebsd.org
Subject:   portable microsecond sleeps - Reply
Message-ID:  <s1d287f1.009@novell.com>

next in thread | raw e-mail | index | archive | help
>>> Brandon Gillespie <brandon@tombstone.sunrem.com>  6/27 12:08pm >>>
We have a server package that talks to a visa pos port.  We run this on
a unixware box and on a freebsd box.  At one point in the code we need
to have a microsecond sleep.  BSD has usleep(), however unixware does not
(unless you use /usr/ucb/cc, which is EXTREMELY broken and buggy, so its
not really an option :)Instead we have tried using select to achieve a
microsecond sleep, but when we run this on the unixware system it munches
CPU time.Any suggestions for other ways to achieve microsecond sleeps?-Brandon
Gillespie

>>>

Ahh, my UnixWare days...

There is no real good way to do this from user space in UnixWare.  The
UCB interfaces in UnixWare are somewhat broke as well.  BTW UnixWare select
is really implemented as a poll [We must walk carefully here otherwise
we will get Terry going!  {:-)  ]  I had implemented a psuedo driver in
UnixWare to use the driver interfaces drv_hztousec(D3) as a highly accurate
clock.  Once having the clock you could "waste" the right amount of time.
 It is quite a trivial driver that implemented and ioctl interface that
would use this interface.  I tried looking for the code, but could not
find it in my archives.  Check into the man page and I think you will get
the idea.

Darren R. Davis
Senior Software Engineer
Novell, Inc.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?s1d287f1.009>