[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Return value of finished threads
From: |
Clément Pit-Claudel |
Subject: |
Re: Return value of finished threads |
Date: |
Fri, 20 Jul 2018 12:17:04 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2018-07-20 11:15, Michael Albinus wrote:
> Eli Zaretskii <address@hidden> 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.