From owner-freebsd-hackers Tue Sep 22 16:00:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA23362 for freebsd-hackers-outgoing; Tue, 22 Sep 1998 16:00:56 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from gatekeeper.tsc.tdk.com (gatekeeper.tsc.tdk.com [207.113.159.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA23314 for ; Tue, 22 Sep 1998 16:00:41 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from sunrise.gv.tsc.tdk.com (root@sunrise.gv.tsc.tdk.com [192.168.241.191]) by gatekeeper.tsc.tdk.com (8.8.8/8.8.8) with ESMTP id PAA01289; Tue, 22 Sep 1998 15:59:42 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from salsa.gv.tsc.tdk.com (salsa.gv.tsc.tdk.com [192.168.241.194]) by sunrise.gv.tsc.tdk.com (8.8.5/8.8.5) with ESMTP id PAA03580; Tue, 22 Sep 1998 15:59:41 -0700 (PDT) Received: (from gdonl@localhost) by salsa.gv.tsc.tdk.com (8.8.5/8.8.5) id PAA19262; Tue, 22 Sep 1998 15:59:39 -0700 (PDT) From: Don Lewis Message-Id: <199809222259.PAA19262@salsa.gv.tsc.tdk.com> Date: Tue, 22 Sep 1998 15:59:39 -0700 In-Reply-To: Don Lewis "Re: The inetd realloc problem: an observation" (Sep 22, 6:32am) X-Mailer: Mail User's Shell (7.2.6 alpha(3) 7/19/95) To: Don Lewis , Graham Wheeler Subject: Re: The inetd realloc problem: an observation Cc: hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sep 22, 6:32am, Don Lewis wrote: } Subject: Re: The inetd realloc problem: an observation } On Sep 22, 3:27pm, Graham Wheeler wrote: } } Subject: Re: The inetd realloc problem: an observation } } } I've just changed the source so that all three signal handlers just set } } flags, and the flags are tested at the start of the main processing loop } } and the old handlers called if necessary. It will be interesting to see } } if this improves things. } } You'll probably want to set a reasonable timeout on select() so that you } don't wait forever if a signal happens when you're not in select() and } no inputs arrive to activate select. Also, if select() returns -1, } the code should examine the flags before returning to the top of the loop. I thought of a more elegant way of handling the timeout problem. Before starting the select loop, create a pipe. Add the fd of the read end of the pipe to the list of descriptors passed to select. In each of the signal handlers, write a single character to the pipe in addition to setting the flag. When select indicates that the pipe has data to read, block the signals that have handlers, read a character from the pipe, test and clear each of the flags, execute the appropriate code for each flag, and unblock signals. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message