diff options
| author | Sam Steingold | 2007-03-25 03:03:40 +0000 |
|---|---|---|
| committer | Sam Steingold | 2007-03-25 03:03:40 +0000 |
| commit | e7d4a9040500018652ec1e626e4eb349c406764e (patch) | |
| tree | bb70f9cfc1a799453a0f0a41b7322b9d49bfd1f9 /src | |
| parent | a0ca081df23387a3f7dc57a61cded8e7c9c1cbe1 (diff) | |
| download | emacs-e7d4a9040500018652ec1e626e4eb349c406764e.tar.gz emacs-e7d4a9040500018652ec1e626e4eb349c406764e.zip | |
revert the last patch to the original fix: sleep BEFORE the first wait
it appears to be absolutely necessary for prevention of the load surge
Diffstat (limited to 'src')
| -rw-r--r-- | src/process.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c index 10bfa762a9b..382db8b2578 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -6501,17 +6501,17 @@ sigchld_handler (signo) | |||
| 6501 | #define WUNTRACED 0 | 6501 | #define WUNTRACED 0 |
| 6502 | #endif /* no WUNTRACED */ | 6502 | #endif /* no WUNTRACED */ |
| 6503 | /* Keep trying to get a status until we get a definitive result. */ | 6503 | /* Keep trying to get a status until we get a definitive result. */ |
| 6504 | while (1) | 6504 | do |
| 6505 | { | 6505 | { |
| 6506 | /* For some reason, this sleep() prevents Emacs from sending | ||
| 6507 | loadavg to 5-8(!) for ~10 seconds. | ||
| 6508 | See http://thread.gmane.org/gmane.emacs.devel/67722 or | ||
| 6509 | http://www.google.com/search?q=busyloop+in+sigchld_handler */ | ||
| 6510 | sleep (1); | ||
| 6506 | errno = 0; | 6511 | errno = 0; |
| 6507 | pid = wait3 (&w, WNOHANG | WUNTRACED, 0); | 6512 | pid = wait3 (&w, WNOHANG | WUNTRACED, 0); |
| 6508 | if (! (pid < 0 && errno == EINTR)) | ||
| 6509 | break; | ||
| 6510 | /* Avoid a busyloop: wait3 is a system call, so we do not want | ||
| 6511 | to prevent the kernel from actually sending SIGCHLD to emacs | ||
| 6512 | by asking for it all the time. */ | ||
| 6513 | sleep (1); | ||
| 6514 | } | 6513 | } |
| 6514 | while (pid < 0 && errno == EINTR); | ||
| 6515 | 6515 | ||
| 6516 | if (pid <= 0) | 6516 | if (pid <= 0) |
| 6517 | { | 6517 | { |