From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Return value of finished threads Date: Fri, 20 Jul 2018 18:08:15 +0300 Message-ID: <83zhymymg0.fsf@gnu.org> References: <87h8kuq7kf.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1532099215 1371 195.159.176.226 (20 Jul 2018 15:06:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 20 Jul 2018 15:06:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 20 17:06:51 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgWzY-0000Bl-Hg for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2018 17:06:48 +0200 Original-Received: from localhost ([::1]:48559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgX1f-0007LX-J2 for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2018 11:08:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgX0z-0007KG-AD for emacs-devel@gnu.org; Fri, 20 Jul 2018 11:08:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgX0y-0001QF-Bq for emacs-devel@gnu.org; Fri, 20 Jul 2018 11:08:17 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgX0y-0001QB-76; Fri, 20 Jul 2018 11:08:16 -0400 Original-Received: from [176.228.60.248] (port=1540 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fgX0x-0004WP-E6; Fri, 20 Jul 2018 11:08:16 -0400 In-reply-to: <87h8kuq7kf.fsf@gmx.de> (message from Michael Albinus on Fri, 20 Jul 2018 16:56:48 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227584 Archived-At: > From: Michael Albinus > Date: Fri, 20 Jul 2018 16:56:48 +0200 > > 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. Do you have an implementation in mind? Because in general, passing variables between threads in C also needs global variables...