🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #38254

Re: Nap call. Was Re: X386 1.2 and X11R5 on SCO

#38254
From: John Temples
Date: Mon, 13 Jan 1992 15:06
35 lines
2442 bytes
In article <BHxB8n.I0y@world.std.com> steveo@world.std.com (Steven W Orr) writes:
>Regarding the nap call from -lx, can someone tell me how it works?

It's a system call, number 0xC28.  The parameter you pass it is the
number of milliseconds to sleep.

>Is it a busy wait or is there something actually useful there that
>suspends the program?

It suspends the program with, as far as I can tell, clock tick (10ms)
resolution. 

>and don't forget everyone. IF YOU USE -lx MAKE SURE YOU USE IT IN
>THE FORM OF -lc -lx

That may be good advice for SCO (I don't know, I've never used it) but
it's bad advice for the other SVR3.2 386 UNIXes.  There is,
unfortunately, another different nap library call in libc.a.  This one
does a CPU busy wait, and sleeps for about 10 times as long as the
"real" nap.  It's in dial.o in libc.a, so I'm guessing it's a UUCP
support routine.  So, you must use -lx -lc on non-SCO systems to get
the correct nap().

I found all this out after purchasing the 386 UNIX version of
Professional YAM for my ESIX 3.2 system.  The program worked fine, but
burned up 100% of available CPU time, even when idle.  I spoke to Chuck
Forsberg about it, and he told me that the program used the nap() call
when it was idle.  After some experimenting, I realized that YAM had
been linked incorrectly and was using the wrong nap() call.  Chuck
suggested I try the SCO UNIX version of YAM, which I did.  That version
resolved the CPU usage problem.

So does SCO have multiple nap() calls as well?
-- 
John W. Temples -- john@jwt.UUCP (uunet!jwt!john)
Technical Details
Message-ID: <1992Jan13.150602.5964@jwt.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!elroy.jpl.nasa.gov!usc!rpi!masscomp!peora!tarpit!bilver!jwt!john
References: <1992Jan12.121737.14962@trevan.uucp> <1992Jan12.160923.3432@mnemosyne.cs.du.edu> <BHxB8n.I0y@world.std.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103734,7664f740ba377765
X-Google-Attributes: gid103734,public
X-Google-Thread: 1048e3,7664f740ba377765
X-Google-Attributes: gid1048e3,public
X-Google-Thread: 134180,7664f740ba377765
X-Google-Attributes: gid134180,public
X-Google-ArrivalTime: 1992-01-13 16:57:32 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!elroy.jpl.nasa.gov!usc!rpi!masscomp!peora!tarpit!bilver!jwt!john
From: john@jwt.UUCP (John Temples)
Newsgroups: comp.windows.x,comp.unix.sysv386,biz.sco.opendesktop
Subject: Re: Nap call. Was Re: X386 1.2 and X11R5 on SCO
Message-ID: <1992Jan13.150602.5964@jwt.UUCP>
Date: 13 Jan 92 15:06:02 GMT
References: <1992Jan12.121737.14962@trevan.uucp> <1992Jan12.160923.3432@mnemosyne.cs.du.edu> <BHxB8n.I0y@world.std.com>
Organization: The Museum of Barnyard Oddities
Lines: 35