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 20:25:13 +0300 Message-ID: <83va99zuo6.fsf@gnu.org> References: <87h8kuq7kf.fsf@gmx.de> <83zhymymg0.fsf@gnu.org> <87d0viq6pv.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1532107426 19172 195.159.176.226 (20 Jul 2018 17:23:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 20 Jul 2018 17:23:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 20 19:23:42 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 1fgZ82-0004sX-B1 for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2018 19:23:42 +0200 Original-Received: from localhost ([::1]:49183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgZA9-0008I1-AC for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2018 13:25:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgZ9W-0008HT-PV for emacs-devel@gnu.org; Fri, 20 Jul 2018 13:25:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgZ9U-00035E-2K for emacs-devel@gnu.org; Fri, 20 Jul 2018 13:25:14 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgZ9T-00034u-Un; Fri, 20 Jul 2018 13:25:11 -0400 Original-Received: from [176.228.60.248] (port=1932 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fgZ9T-00023Y-DF; Fri, 20 Jul 2018 13:25:11 -0400 In-reply-to: (message from =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel on Fri, 20 Jul 2018 12:17:04 -0400) 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:227591 Archived-At: > From: Clément Pit-Claudel > Date: Fri, 20 Jul 2018 12:17:04 -0400 > > On the ELisp side, I wonder if it'd make sense to attach a plist to each thread. With this you would do (thread-put t 'result (returned value)) from the thread, and on the waiting side you'd run thread-join before accessing the result with (thread-get t 'result) When the thread function returns, the thread is dead, and I'm not sure we should encourage using plists of dead threads.