Jenny Zhao (zhz++at++dandan.engr.sgi.com)
Mon, 29 Mar 1999 10:17:49 -0800
> 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.
If you are not running as root or have real-time privilage,
this new sginap() behavior might make you miss frames if
you are locking to anything less than 60Hz.
We are working with our OS group to resolve this problem.
For now, running as root or get real-time privilage for your
job is the way to go.
Jenny Zhao zhz++at++engr.sgi.com 650 933-5091
This archive was generated by hypermail 2.0b2 on Mon Mar 29 1999 - 10:17:52 PST