emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change in process.c


From: Kim F. Storm
Subject: Re: Change in process.c
Date: Wed, 28 Mar 2007 22:57:05 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux)

Jan Djärv <address@hidden> writes:

> I can see this too.  But it is this code that gets executed over and
> over again (process.c, line 4810 or so):

Good catch!!

Does the following patch give good results?

*** process.c   28 Mar 2007 11:18:56 +0200      1.508
--- process.c   28 Mar 2007 22:55:11 +0200      
***************
*** 4820,4826 ****
                 got lost.  So raise the signl again just in case.
                 It can't hurt.  */
              else if (nread == -1 && errno == EIO)
!               kill (getpid (), SIGCHLD);
  #endif                                /* HAVE_PTYS */
              /* If we can detect process termination, don't consider the 
process
                 gone just because its pipe is closed.  */
--- 4820,4832 ----
                 got lost.  So raise the signl again just in case.
                 It can't hurt.  */
              else if (nread == -1 && errno == EIO)
!               {
!                 /* Clear the descriptor now, so we only raise the signal 
once.  */
!                 FD_CLR (channel, &input_wait_mask);
!                 FD_CLR (channel, &non_keyboard_wait_mask);
! 
!                 kill (getpid (), SIGCHLD);
!               }
  #endif                                /* HAVE_PTYS */
              /* If we can detect process termination, don't consider the 
process
                 gone just because its pipe is closed.  */
***************
*** 6502,6512 ****
        /* Keep trying to get a status until we get a definitive result.  */
        do
          {
-         /* For some reason, this sleep() prevents Emacs from sending
-              loadavg to 5-8(!) for ~10 seconds.
-              See http://thread.gmane.org/gmane.emacs.devel/67722 or
-              http://www.google.com/search?q=busyloop+in+sigchld_handler */
-           usleep (1000);
          errno = 0;
          pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
        }
--- 6508,6513 ----

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]