[PD] usleep() equivalent to Sleep() -- CORRECTION?
Miller Puckette
mpuckett at man104-1.ucsd.edu
Mon May 13 18:55:12 CEST 2002
Sorry, I should have said that this is my experience in W2K.
I've never seen a unix() that doesn't implement select() correctly!
As to sys_microsleep(), it's in Pd, not the OS, and has the good property
that it wakes up if GUI or netreceive() input arrives while it's sleeping.
On that note, however, if you're writing a Pd extern it's probably better to
use a clock_delay() callback; this way, teh rest of Pd won't hang while you
wait.
cheers
Miller
On Mon, May 13, 2002 at 09:43:27AM -0700, Miller Puckette wrote:
> But I recently discovered that select() works only if you have an open
> socket. So if you're running "-nogui" it won't do any timing for you
> unless you make your own (or startup a netreceive object).
>
> cheers
> Miller
>
> On Mon, May 13, 2002 at 01:30:40PM +0200, martin pi wrote:
> >
> >
> > but it is recommended to use select() with NULLs
> > and a timeval struct instead, i was told once.
> >
> > martin
> >
> >
> >
> > On Sun, 12 May 2002 jdavison at speakeasy.org wrote:
> >
> > > As long as we're on the subject, it's worth noting that usleep isn't a standard
> > > UNIX function. "nanosleep" is.
> > >
> > > --
> > > John Davison, jdavison at-sign speakeasy period org
> > >
> > >
> >
> >
> > martin pi
> > attacksyour.net/pi
> >
> > johann strauss gasse 32 | 7
> > 1040 vienna
> > ++43 699 10 44 37 42
> >
> > sil.at
> >
> >
> >
More information about the Pd-list
mailing list