[Top][All Lists]

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

Return value of finished threads

From: Michael Albinus
Subject: Return value of finished threads
Date: Fri, 20 Jul 2018 16:56:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)


these days I'm working on making Tramp thread-safe. This works already,
but is only part of the job.

The other part is *using* threads. My first use case I'll try to
implement is `find-file' with wildcards. That is, for every single file
to be loaded, an own thread is created. A user indicates this
interactively by a prefix argument like "C-u M-x find-file ...".

What I'm missing is a simple possibility to collect the return values of
the respective finished threads (`find-file-noselect' calls), which is a
buffer or a list of buffers. The documentation recommends the use of
global variables, which would be inconvenient for many threads to supervise.

So I'm wondering if we could extend thread support by an indication of
the thread result, when finished. One idea would be that `thread-join'
returns with that value.

Another idea, even broader, would be to extend `condition-notify' by an
argument, which passes a Lisp object to another thread. The
corresponding `condition-wait' would return that value.

What do people think?

Best regards, Michael.

reply via email to

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