[Home] [Groups] - Message: [Prev in Group] [Next in Group]
7243: [MUD-Dev] Re: lurker emerges
[Full Header] [Plain Text]
From: J C Lawrence <claw@under.engr.sgi.com>
Newsgroups: nu.kanga.list.mud-dev
Date: Wed, 16 Sep 1998 17:30:39 -0700
References: [1]
Organization: Kanga.Nu
On Sun, 9 Aug 1998 23:28:17 -0600
Chris Gray<cg@ami-cg.GraySage.Edmonton.AB.CA> wrote:
> I'm bumping into this right now with my simple MUD client. I call
> out to an external editor for editing stuff, but the client needs
> to stay active while that editing is going on. So, to know when
> the editor process is done, I need to set up a SIGCHLD handler and
> catch the process exit. However, that is a signal, which if I'm
> not careful can cause error reports from 'read's on user input and
> on read/writes to the socket to the server. Ick. Give me true
> asynchronous I/O (like on the Amiga) anyday!
A common approach:
fork a child.
Have the child fork the editor.
Have the child catch the SIGCHILD from the editor.
Have the child send a normal IPC message (pipe, whatever) to the
parent before terminating silently (turn off SIGCHILD).
Have the parent respond to the message whenever it wants.
True, its nasty, ugly, and brutish as well as being inelegant and
resource expensive. It also works.
--
J C Lawrence Internet: claw@null.net
(Contractor) Internet: coder@ibm.net
---------(*) Internet: claw@under.engr.sgi.com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...