Does AIX have a function like sginap()?
John D. McCalpin
mccalpin at perelandra.cms.udel.edu
Fri Mar 8 12:08:17 AEST 1991
I am working on a FORTRAN application that needs to sit and wait for
certain data files to be completely written. The basic loop is
OPEN(in_unit,....)
8888 READ(in_unit,ERR=8888,END=8888) data
CLOSE(in_unit)
This works fine, but uses up lots of system time that would be better
spent by the other process that is supposed to be writing the data!
On the Silicon Graphics machines, there is a nice function called
'sginap(i)' which:
-- with an argument of 0, will release control to any other
process with the same or higher priority; or
-- with an argument i>0, will sleep for 'i' clock ticks.
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.
Is this functionality available in a more standard UNIX call?
Does AIX have this functionality? This is important, since I really
want to run the application on a network of IBM 320's sharing files
via NFS.
--
John D. McCalpin mccalpin at perelandra.cms.udel.edu
Assistant Professor mccalpin at brahms.udel.edu
College of Marine Studies, U. Del. J.MCCALPIN/OMNET
More information about the Comp.unix.aix
mailing list