Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!turnkey!orchard.la.locus.com!fafnir.la.locus.com!fafnir.la.locus.com!richard From: richard@locus.com (Richard M. Mathews) Newsgroups: comp.unix.aix Subject: Re: Does AIX have a function like sginap()? Message-ID: Date: 9 Mar 91 04:06:58 GMT References: Organization: Locus Computing Corporation, Los Angeles, California Lines: 26 mccalpin@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@locus.com Laisve! lcc!richard@seas.ucla.edu ...!{uunet|ucla-se|turnkey}!lcc!richard