Does AIX have a function like sginap()?

Richard M. Mathews richard at locus.com
Sat Mar 9 14:06:58 AEST 1991


mccalpin at perelandra.cms.udel.edu (John D. McCalpin) writes:

>The modified code segment:
>	OPEN(in_unit,....)
> 8888	idummy = sginap(0)
>	READ(in_unit,ERR=8888,END=8888) data
>	CLOSE(in_unit)
>runs much more efficiently.

>I cannot use the normal 'sleep()' routines, since the actual latencies
>involved are much smaller than 1 second, and the OPEN/READ/CLOSE
>sequence needs to be done several times per second.

Any system call should have the property of giving up control to a
higher priority process.  I am almost certain that is true in AIX/370
and AIX PS/2.  I am less certain on the 6000.  Try getpid().  (Or
does sginap go farther and explicitly put you at a low priority?)

Better yet, can you use select()?  This will let you sleep until
there is data available -- no shorter, no longer (ignoring the time
it takes for you to make it to the front of the run queue).

Richard M. Mathews			 Freedom for Lithuania
richard at locus.com				Laisve!
lcc!richard at seas.ucla.edu
...!{uunet|ucla-se|turnkey}!lcc!richard



More information about the Comp.unix.aix mailing list