<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p> There are only two hard things in Computer Science: cache
invalidation and naming things.<br>
<br>
-- Phil Karlton<br>
</p>
<p><img src="cid:part1.QyeayI7i.GyIvGPbP@kolotyluk.net" alt=""></p>
<p>So, what does "Subtask" mean when there is no "Task"?<br>
<br>
Personally, I would go with either just "Task" or
"StructuredScopeTask" as "Subtask" is sort of inventing new
terminology. <br>
<br>
If you renamed "StructuredTaskScope" to just "Task" then "Subtask"
would make more sense as it is something spawned from a Task. This
would be my preferred choice. Shorter names for common things...
in particular things that should become common.<br>
</p>
<p>However, what is the relationship to "Task" with all those other
things called "...Task..." Maybe just "ConcurrentTask" and
"ConcurrentSubtask" are more meaningful, but
"java.util.concurrent.Task" and "java.util.concurrent.Subtask" are
probably clear enough. </p>
<p>In a sense, we would be saying that all Concurrent Tasks should
be Structured.</p>
<p>Cheers, Eric<br>
</p>
<div class="moz-cite-prefix">On 2023-05-18 11:59 a.m., Ron Pressler
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:67C02D42-08D5-4732-86D9-6364505F4C1C@oracle.com">
<pre class="moz-quote-pre" wrap="">Hi.
We have made several changes to structured concurrency (JEP 453) due to feedback:
1. We've renamed `TaskHandle` to `Subtask`. I can't promise it's the last rename :)
2. We've fixed the generic signature of handleComplete (thank you Rémi for pointing out the mistake)
3. We've changed the states and behaviour of subtasks on cancellation. Subtasks that are forked after `shutdown` is called will have the `STILLBORN` state. Running subtasks will be interrupted, but the state of their `Subtask` will remain `RUNNING` until completed, probably sometime after `join` has returned, because `join` returns immediately when `shutdown` is called. When completed, their `Subtasks` will be passed to `handleComplete`, either in the `FAILED` or `SUCCESS` state. I.e., Unlike `Future`, the state reflects the state of the task itself, not of the handle.
4. We've added the com.sun.management.Threads.currentThreadEnclosingScopes() method that returns a string with the description of the current structured context -- i.e. the stack trace for the current thread and the enclosing scopes with their owners' respective stack traces -- all the way up the hierarchy.
<a class="moz-txt-link-freetext" href="https://openjdk.org/jeps/453">https://openjdk.org/jeps/453</a>
-- Ron
</pre>
</blockquote>
</body>
</html>