emacs-devel
[Top][All Lists]
Advanced

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

Re: Change in process.c


From: Sam Steingold
Subject: Re: Change in process.c
Date: Wed, 28 Mar 2007 09:55:10 -0400
User-agent: Thunderbird 1.5.0.8 (X11/20061107)

Chong Yidong wrote:
Richard Stallman <address@hidden> writes:

I don't mind making a change to fix this,
but it must not do a full-second sleep before the first wait3,
and it must not use usleep since that is obsolete.

Does this version work?

no, absolutely NOT.
there must be a sleep BEFORE the first wait.
something equivalent to your version was tried and found lacking.

*** emacs/src/process.c.~1.508.~        2007-03-27 16:47:03.000000000 -0400
--- emacs/src/process.c 2007-03-27 17:13:31.000000000 -0400
***************
*** 6500,6516 ****
  #define WUNTRACED 0
  #endif /* no WUNTRACED */
        /* 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);
        }
-       while (pid < 0 && errno == EINTR);
if (pid <= 0)
        {
--- 6500,6518 ----
  #define WUNTRACED 0
  #endif /* no WUNTRACED */
        /* Keep trying to get a status until we get a definitive result.  */
! ! errno = 0;
!       pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
!       while (pid < 0 && errno == EINTR)
          {
          /* 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 */
!           sleep (1);
          errno = 0;
          pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
        }
if (pid <= 0)
        {





reply via email to

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