emacs-pretest-bug
[Top][All Lists]
Advanced

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

list-processes and process sentinels not run.


From: Matt Hodges
Subject: list-processes and process sentinels not run.
Date: Sat, 30 Sep 2006 16:05:53 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

In GNU Emacs 22.0.50.3 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2006-09-29 on saiga
X server distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure '--with-gtk''

If a process status changes to exit and list-processes is called
without there being idle time, then the process is removed in
list_processes_1:

      if (EQ (symbol, Qsignal) || EQ (symbol, Qexit))
        remove_process (proc);

and the process sentinel isn't run.  This can be demonstrated with:

    (let ((proc (start-process "test-seq" nil "/bin/sleep" "0")))
      (set-process-sentinel proc (lambda (proc msg)
                                   (message msg)))
      (while (delq nil (mapcar (lambda (p)
                                 (string-match "test-seq" (process-name p)))
                               (process-list)))
        (list-processes)))

but I think the same problem is responsible for my observation that
process sentinels sometimes don't get run in an application I am
developing.  Admittedly, I only see the problem when there is a
constant turnover of many concurrent short-lived processes, but maybe
it is possible to reproduce with one process and an
unfortunately-timed list-processes call.

Is the fact that a process status can change, and the process sentinel
not be run a bug?

(If the above analysis is incorrect, and I have misunderstood
something about processes and sentinels, then sorry.)

Thanks,

Matt




reply via email to

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