Re: nanosleep & sginap

New Message Reply Date view Thread view Subject view Author view

Mattias.Johansson++at++saab.se
Thu, 01 Apr 1999 11:29:03 +0200


EXT AVS; Jenny Zhao wrote:
>
> Moshe Nissim wrote:
>
> > Ken Lindsay wrote:
> >
> > > i had done some fiddlin' a few weeks ago trying to get better resolution
> > > than sginap provides, and so i tested nanosleep and usleep. my conclusion
> > > was that their resolution (at least in the default setup in IRIX 6.5.1)
> > > is 10 milliseconds, just like sginap. here is some sample data:
> > >
> > >
> >
> > It is not a "resolution" problem, but an extra time-slice.
> > Time-slice is 10ms in non-priority processes, and 1 ms in realtime priority processes.
> > Also when the time-slice is 1ms there is an extra slice of sleep. Thus you get
> > 11 ms from sginap.
> > My nanosleep tests reproduced the same symptom.
> > So it appears to be a basic kernel scheduling problem, not specific to sginap.
>
> I will also try my hand at explaining this kernel scheduling feature.
> If it is still not very clear, we will get some experts from our
> IRIX group to give more specific details.
>
> You need REAL-TIME privilage to have access to
> the 1ms fast clock.
> Otherwise, you get the 10ms clock tick.
> Running as root gives you this REAL-TIME privilage. The root
> can also grant this privilage to certain jobs.
>
> The command sginap() has changed its behavior in 6.5 and later.
> The old behavior is to sleep UP TO x clock ticks where x is the
> argument in sginap(x). If there is an interrupt before the
> time is up, sginap will return and Performer swaps buffers.
> This is how inside Performer we handle the synchronization
> in LOCK mode.
> The new behavior, in the interest of making sginap() behave
> the same way as other sleeps, is to sleep AT LEAST
> x clock ticks. If an interrupt happens before the x clock ticks,
> then sginap() will wake up after that last tick.
>
>

Somebody forgot to update the manuals... or tell me about it, though :-)
From the manual:

 Note that if the calling thread is interrupted by a signal before the
     specified number of ticks has elapsed, sginap will return
prematurely.

sgi17:[19]~>uname -a
IRIX64 sgi17 6.5 01221643 IP27


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Apr 01 1999 - 01:29:21 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.