From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: busyloop in sigchld_handler Date: Sun, 11 Mar 2007 21:42:27 +0100 Message-ID: References: <85fy8bpnvy.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173645719 18599 80.91.229.12 (11 Mar 2007 20:41:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2007 20:41:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 11 21:41:52 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HQUrR-0003dI-UK for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 21:41:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQUs1-0003Pl-AF for ged-emacs-devel@m.gmane.org; Sun, 11 Mar 2007 15:42:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQUrq-0003Pf-VA for emacs-devel@gnu.org; Sun, 11 Mar 2007 16:42:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQUrn-0003PT-Ag for emacs-devel@gnu.org; Sun, 11 Mar 2007 16:42:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQUrn-0003PQ-4D for emacs-devel@gnu.org; Sun, 11 Mar 2007 15:42:07 -0500 Original-Received: from pfepb.post.tele.dk ([195.41.46.236]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HQUrC-0005CS-IA for emacs-devel@gnu.org; Sun, 11 Mar 2007 16:41:30 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx19.adsl-dhcp.tele.dk [80.62.38.68]) by pfepb.post.tele.dk (Postfix) with SMTP id 86817A5003D for ; Sun, 11 Mar 2007 21:41:27 +0100 (CET) In-Reply-To: (Sam Steingold's message of "Sun\, 11 Mar 2007 15\:51\:56 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67735 Archived-At: Sam Steingold writes: >> * David Kastrup [2007-03-11 20:43:13 +0100]: >> storm@cua.dk (Kim F. Storm) writes: >>> Sam Steingold writes: >>> >> >> Wouldn't it make more sense to do >> >> for (;;) { >> errno = 0; >> pid = wait3(&w, WNOHANG | WUNTRACD, 0); >> if (!(pid < 0 && errno == EINTR)) >> break; >> sleep(1); >> } >> >> That way, we don't get an obligatory sleep if things happen to work >> without it. > > yes - my point was to make the change as small as possible to make it > clear what I want (and minimize opposition). it appears that people do > not mind, so I will modify it along your lines. I already tried that, and it didn't work !!! I also tried a shorter sleep (usleep(100000)) before the first wait, and it didn't work either -- emacs did remain respond briefly just after M-x compile completed, but then it became unresponsive for ~10 seconds. That's why I asked you to explain how the change is supposed to work. -- Kim F. Storm http://www.cua.dk