I need a SysV select()

Phil Harbison alvitar at madhat.UUCP
Fri May 27 08:44:45 AEST 1988


In article <2643 at c3engr.UUCP>, charles at c3engr.UUCP (Charles Green) writes:
> 
> My favorite solution is to have several small "multiplexor" processes,
> all identical but exec()ed with a unique numeric argument, reading their
> respective stdins ... When one of the multiplexor processes completes a
> read(), he does a single write() to the pipe containing his unique ID,
> a byte count, and the data.
> 

I use a similar approach on my version of emacs to implement subprocesses
running in emacs windows.  It is a major win on the Sys5 version since the
previous approach used lots of CPU time doing NODELAY reads on the keyboard
and childs stdout pipe.  Another big win is I only have one version of the
code that runs on v7, BSD, and USG flavors of UNIX.  A nice side effect is
that polling the keyboard is simple, since I can do an fstat to discover
how much data is in the IPC pipe.  If anyone wants example code, drop me
a note in the mail.


-- 
Live: Phil Harbison
USPS: 3409 Grassfort Drive, Huntsville, AL 35805-5421
UUCP: clyde!madhat!alvitar
PSTN: 205-881-4317 or 205-830-4310x210



More information about the Comp.unix.wizards mailing list