all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: 33018@debbugs.gnu.org
Subject: bug#33018: 26.1.50; thread starvation with async processes and accept-process-output
Date: Tue, 16 Oct 2018 15:54:02 +0200	[thread overview]
Message-ID: <87sh16ro91.fsf@gmx.de> (raw)
In-Reply-To: <877eiipu8g.fsf@tcd.ie> (Basil L. Contovounesios's message of "Tue, 16 Oct 2018 02:15:27 +0100")

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> There's something about going through a complete create-join cycle more
> than once within a non-main-thread which is triggering this behaviour.

I'm not sure that it is related to threads. It looks, like some of your
processes do not exit properly, and then thread-join is blocked.

I've modified your example, again. It runs perfectly. And during its
work, you could call "M-x list-threads" and see how the threads are
created and die.

Best regards, Michael.


[-- Attachment #2: Type: text/plain, Size: 1241 bytes --]

diff -u /home/albinus/tmp/test.el.\~1\~ /home/albinus/tmp/test.el
--- /home/albinus/tmp/test.el.~1~	2018-10-16 14:46:47.000000000 +0200
+++ /home/albinus/tmp/test.el	2018-10-16 15:47:05.581276541 +0200
@@ -19,9 +19,9 @@
 (defun test-slave ()
   "Create an asynchronous process and wait for it to exit."
   (let ((proc (make-process
-               :name "test"
+               :name (thread-name (current-thread))
                :buffer (generate-new-buffer " *test*")
-               :command '("wget" "-qO-" "https://en.wikipedia.org/wiki/Emacs")
+               :command `("echo" ,(thread-name (current-thread)))
                :connection-type 'pipe
                :sentinel #'test-sentinel)))
     (while (eq (process-status proc) 'run)
@@ -32,10 +32,10 @@
   "Successively run `test-slave'.
 With non-nil ASYNC, use a new thread for each invocation."
   (if async
-      (dotimes (_ 2)
+      (dotimes (i 100)
         (let (threads)
-          (dotimes (i 2)
-            (push (make-thread #'test-slave (format "test-%d" i)) threads))
+          (dotimes (j 100)
+            (push (make-thread #'test-slave (format "test-%d-%d" i j)) threads))
           (mapc #'thread-join threads)))
     (dotimes (_ 2)
       (test-slave))))

  reply	other threads:[~2018-10-16 13:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 14:57 bug#33018: 26.1.50; thread starvation with async processes and accept-process-output Basil L. Contovounesios
2018-10-12  8:07 ` Eli Zaretskii
2018-10-14 15:00   ` Basil L. Contovounesios
2018-10-14 15:17     ` Eli Zaretskii
2018-10-14 15:36       ` Basil L. Contovounesios
2018-10-12 12:02 ` Michael Albinus
2018-10-12 12:43   ` Eli Zaretskii
2018-10-12 12:49     ` Michael Albinus
2018-10-14 15:17   ` Basil L. Contovounesios
2018-10-15  8:02     ` Michael Albinus
2018-10-16  1:15       ` Basil L. Contovounesios
2018-10-16 13:54         ` Michael Albinus [this message]
2018-10-16 14:55           ` Basil L. Contovounesios
2018-10-16 14:58         ` Eli Zaretskii
2018-10-17 17:37           ` Basil L. Contovounesios
2018-10-17 17:56             ` Eli Zaretskii
2018-10-17 18:05               ` Basil L. Contovounesios
2018-10-17 18:20                 ` Eli Zaretskii
2018-10-17 18:25                   ` Eli Zaretskii
2018-10-17 20:46                     ` Basil L. Contovounesios
2018-10-20  8:34                       ` Eli Zaretskii
2018-10-17 20:02                   ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh16ro91.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=33018@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.