Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mandrill!gatech!sbmsg1!scbhq!uahcs1!madhat!alvitar From: alvitar@madhat.UUCP (Phil Harbison) Newsgroups: comp.unix.wizards Subject: Re: I need a SysV select() Message-ID: <266@madhat.UUCP> Date: 26 May 88 22:44:45 GMT References: <9738@sol.ARPA> <7904@brl-smoke.ARPA> <11536@mimsy.UUCP> <2643@c3engr.UUCP> Organization: DataVision, Huntsville AL Lines: 24 Posted: Thu May 26 18:44:45 1988 In article <2643@c3engr.UUCP>, charles@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