From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] threads in Plan 9 From: Richard Miller MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: Date: Sat, 28 Apr 2001 17:00:01 +0100 Topicbox-Message-UUID: 96387da0-eac9-11e9-9e20-41e7f4b1d025 > I used to have great fun with mothra when one process would crash, and > leave the rest deadlocked or otherwise boggled. This behaviour seems to be a consequence of the atnotify handler in the event(2) package used by mothra. When a note is received in the main process, the handler sends a "die" note to all the subprocesses and returns 0 to request the default exception action (exit or suspend). But when a note is received in a subprocess, the handler simply returns 1 to request continuation. If the note occurred during a system call (e.g. reading from the network), in most cases the continued mothra process will detect the abnormal return and exit. If not, the "die" note is simply ignored and deadlock results. I wonder whether /sys/src/libdraw/event.c:#6972,#6980 should be "return 0" ? -- Richard