Structured concurrency: TaskHandle

Alan Bateman Alan.Bateman at oracle.com
Sat May 13 06:28:51 UTC 2023


On 12/05/2023 22:54, forax at univ-mlv.fr wrote:
> :
> I'm thinking about the case where a user take a look at the state() after a call to shutdown() followed by a call to join(),
> see the example in my email to Ron.
>
In your example, the main task forks two subtasks, sleeps for 1ms, then 
calls shutdown. The first subtask is computing something, it may 
complete successfully before shutdown, it may not and thus its terminal 
state will be SUCCESS or CANCELLED. The second subtask sleeps for 1s 
before throwing an exception so it's likely terminal state is CANCELLED. 
I understand the example is contrived but I think I've missed your 
point. Are you talking about race in the older Future based 
implementation or are you talking about something with the updated 
API/implementation?

-Alan


More information about the loom-dev mailing list