From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Slawomir Nowaczyk Newsgroups: gmane.emacs.devel Subject: Re: Running two processes rapidly makes Emacs eat 100% CPU on w32 Date: Fri, 03 Nov 2006 22:11:02 +0100 Message-ID: <20061103220220.C1BF.SLAWOMIR.NOWACZYK.847@student.lu.se> References: <20061027001549.E487.SLAWOMIR.NOWACZYK.847@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1162588333 8469 80.91.229.2 (3 Nov 2006 21:12:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Nov 2006 21:12:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 03 22:12:10 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gg6KT-0002ww-I3 for ged-emacs-devel@m.gmane.org; Fri, 03 Nov 2006 22:11:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gg6KS-0006y8-Qy for ged-emacs-devel@m.gmane.org; Fri, 03 Nov 2006 16:11:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gg6Jm-0006me-FM for emacs-devel@gnu.org; Fri, 03 Nov 2006 16:11:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gg6Jk-0006lw-Uj for emacs-devel@gnu.org; Fri, 03 Nov 2006 16:11:14 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gg6Jk-0006lo-Nq for emacs-devel@gnu.org; Fri, 03 Nov 2006 16:11:12 -0500 Original-Received: from [130.235.16.11] (helo=himmelsborg.cs.lth.se) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gg6Ji-0007Cg-Pj for emacs-devel@gnu.org; Fri, 03 Nov 2006 16:11:11 -0500 Original-Received: from [127.0.0.1] (slawek@dain [130.235.16.76]) by himmelsborg.cs.lth.se (8.13.6/8.13.6/perf-jw-tr) with ESMTP id kA3LB1hD025740 for ; Fri, 3 Nov 2006 22:11:05 +0100 (CET) Original-To: emacs-devel@gnu.org In-Reply-To: <20061027001549.E487.SLAWOMIR.NOWACZYK.847@student.lu.se> X-Esmandil_Citation: done X-Mailer-Plugin: Popup Memopad for Becky!2 Ver.0.02 Rev.2 X-Mailer: Becky! ver. 2.25.02 [en] 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:61720 Archived-At: On Fri, 27 Oct 2006 23:36:22 +0200 Slawomir Nowaczyk wrote: #> So, the following patch fixes the problem for me, but I have no way of #> knowing if it really is a correct solution. I have been running with it #> for a couple of days now and haven't notice anything wrong, though. I #> have also verified that both processes are correctly reap_subprocess'ed #> in the (progn (start-process "" nil "ls") (call-process "ls")) case. #> #> ********************************************************************** #> #> --- m:/EmacsCVS/EmacsCVS/src/w32proc_orig.c 2006-09-26 20:28:27.518832000 +0200 #> +++ m:/EmacsCVS/EmacsCVS/src/w32proc.c 2006-10-27 00:12:26.527475200 +0200 #> @@ -486,7 +486,8 @@ #> { #> for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--) #> /* some child_procs might be sockets; ignore them */ #> - if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess) #> + if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess #> + && (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0)) #> { #> wait_hnd[nh] = cp->procinfo.hProcess; #> cps[nh] = cp; #> #> ********************************************************************** I have now been running with this patch applied for over a week and haven't seen a single instance of emacs eating 100% CPU... before, in my setup, it was happening at least twice or three times per week. I have not noticed any other problems, either. Therefore, I suggest applying this patch. ********************************************************************** Here is changelog entry: 2006-10-27 Slawomir Nowaczyk * w32proc.c: (sys_wait) Only wait for processes with fd<0. Others should be handled by sys_select instead. Fixes problems with (progn (start-process "" nil "ls") (call-process "ls")) ********************************************************************** -- Best wishes, Slawomir Nowaczyk ( slawomir.nowaczyk.847@student.lu.se ) Nostalgia isn't what it used to be.