<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<br>
<br>
<div class="moz-cite-prefix">On 24/09/2025 16:37, Remi Forax wrote:<br>
</div>
<blockquote type="cite" cite="mid:715342229.35882407.1758728261503.JavaMail.zimbra@univ-eiffel.fr">
<pre wrap="" class="moz-quote-pre">:
And now two remarks,
- is there a way to remove the limitation that the main thread (the one that have created the STS) can not access to SubTask.get(),
because there is at least a case where i know that the task is finished before join() is called (see below).</pre>
</blockquote>
<br>
This restriction is there to ensure that the API is used as
intended. Subtasks are forked individually and then joined as a
unit. If the API allowed Subtask::get to be used before join then it
would be very fragile as it would be like a "wait-less"
Future::get. It might work sometimes, but if a subtask were slow
then Subtask::get would throw ISE.<br>
<br>
<blockquote type="cite" cite="mid:715342229.35882407.1758728261503.JavaMail.zimbra@univ-eiffel.fr">
<pre wrap="" class="moz-quote-pre">
- is there a way to get a joiner that returns the list of subtask in the order if their completeness, not in the order of onFork() ?
</pre>
</blockquote>
A Joiner can collect in its onComplete method so that will give you
completion order. That said, I suspect you might be asking something
different. Are you thinking about APIs such as CompletionService
where you get a wakeup as subtasks complete rather join as a unit?<br>
<br>
-Alan<br>
</body>
</html>