Standard way to yield cpu

Scott Hess scott at next-8.gac.edu
Mon Nov 26 15:34:09 AEST 1990


Is there any method under standard Unix to yield up the CPU so that other
tasks can run for a time?  I speculate that a call to sleep() with 0
timeout _might_ do it, but someone may just have optimized that part . . .
I could do testing, but it would not be very conclusive, as I'd have no
way of telling whether another task actually ran.

OS:  Unix over Mach on a NeXT.  BSD4.3 to the rest of the world.

Before you flame away, I am _not_ going to be doing polling.  Well, not
like you think.  I'm using a library built over select() to catch
incoming data on a pty line.  It would be advantageous to catch more
data from an emacs on the other end (it's a terminal emulator)
before doing redraws.  Of course, I'd not wait for something which
can blast data (like cat), but in the case of emacs, blast is not
exactly the word to use . . . (don't worry, vi does no better).

--
scott hess
scott at gac.edu
Independent NeXT Developer	(Stuart)
GAC Undergrad			(Horrid.  Simply Horrid.  I mean the work!)
<I still speak for nobody>



More information about the Comp.unix.questions mailing list