From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Return value of finished threads Date: Fri, 20 Jul 2018 12:17:04 -0400 Message-ID: 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 1532103320 13186 195.159.176.226 (20 Jul 2018 16:15:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 20 Jul 2018 16:15:20 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 20 18:15:16 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 1fgY3k-0003Hq-AI for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2018 18:15:12 +0200 Original-Received: from localhost ([::1]:48937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgY5q-0001ha-Hy for ged-emacs-devel@m.gmane.org; Fri, 20 Jul 2018 12:17:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgY5e-0001gt-IM for emacs-devel@gnu.org; Fri, 20 Jul 2018 12:17:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgY5b-00010i-10 for emacs-devel@gnu.org; Fri, 20 Jul 2018 12:17:10 -0400 Original-Received: from mail-qt0-x22e.google.com ([2607:f8b0:400d:c0d::22e]:43000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgY5a-000107-Ri for emacs-devel@gnu.org; Fri, 20 Jul 2018 12:17:06 -0400 Original-Received: by mail-qt0-x22e.google.com with SMTP id z8-v6so10735802qto.9 for ; Fri, 20 Jul 2018 09:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=wXG2Mq6F8rQQ949pATtXO9BoCjCOmfnDu6v8+WSfwYk=; b=rL8In5c6sIyVyaACFJ+5Ggo5GOyLqMzd3DxgJ3wv2KagO3pK9Md/utik1M9dKDykYN LdonW6ewev8AumFHt8QgDbuwKMTGILp97RZY4ovH1LKQ0bUFJhSK+ozdotHKb7Z4d6Yh W/ZF7hYQzO8koCtr5tP1E7nq5TXBeIykQanyFGpqE1K14SIhKkV4WAqsvzVUqzK2Sqtg AhMOl65mqB6qS2w40gwpe/uUrc90xiuMBTQUTN3eIDFzvL5Dw2wcCBsYoBElsX+/RfV3 6NWRr4d18Ydgm8MxsdEwcVEi2DNTCXISKwiy+SAHIFYa1WsECAkEOeK/zuXlxgE+Sflr 4Naw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wXG2Mq6F8rQQ949pATtXO9BoCjCOmfnDu6v8+WSfwYk=; b=hFvn6GJis3BFrG7gJcU9HEIQMEnLBjn8r7vKq1CSahb6YeOmbA4XOnTqh0fYkfby28 MrE0dIRb9qeAuhQtye6Be0VhM28GVgD2aakkdOWOtqXSS/A49GM5avYOa+OVt6gyePRB FAirzuJfAtSBQGFCLBZjrjVmmGM3MKX2x6KBOQXwlyiSt9L+bdgCmV6Vm+QSa2khlwEi aYZ8+k2p//5ynsGWaUKkuvcpnsYzfRVgB9hvK40T2qvC8PUlGYIVf7/qCoL4ufV353Bp Pqn1FfWWB9mtAN82McrtH9vVgS5eY1rHeQf0KeQh3vtKgN5345hQX0JPuEbgM3ls2p2l c9fw== X-Gm-Message-State: AOUpUlHqtQOmwHT13wYgyug9uLrbqGoYOM+mroisnhCHS3RAFiasy2yi O6iyDc1ehGR9vh8qEmBF5SpAwhwd X-Google-Smtp-Source: AAOMgpdZxo6anIBbw3DJFTuFlAVNaowkS0/GYOPk45X90VOnPot5BqGXxyeKqK85v06kZu6/NveMwg== X-Received: by 2002:a0c:ba96:: with SMTP id x22-v6mr2378783qvf.98.1532103426077; Fri, 20 Jul 2018 09:17:06 -0700 (PDT) Original-Received: from [18.26.2.123] (26-2-123.dynamic.csail.mit.edu. [18.26.2.123]) by smtp.gmail.com with ESMTPSA id z1-v6sm2007529qta.19.2018.07.20.09.17.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jul 2018 09:17:05 -0700 (PDT) In-Reply-To: <87d0viq6pv.fsf@gmx.de> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22e 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:227589 Archived-At: On 2018-07-20 11:15, Michael Albinus wrote: > Eli Zaretskii writes: > >> Do you have an implementation in mind? Because in general, passing >> variables between threads in C also needs global variables... > > Not (yet). > > I've written this from my use case point of view. It is obvious that > global variables are needed (maybe kept in a hash or so), but I rather > give this task to threads.c, instead writing it myself (and urging > anybody else to write it herself). 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) Clément.