Can StructuredTaskScope be generalized?

Alan Bateman alan.bateman at oracle.com
Mon Oct 7 08:32:20 UTC 2024



On 07/10/2024 08:59, Mike Hearn wrote:
> That’s fair enough, but I think there’s still value in a quick rename now, as “thread” is more precise and frees up the word “task” for a later abstraction (if any).
>
StructuredTaskScope [1] is all about tasks splitting into concurrent 
subtasks. Yes, there is a new thread started to execute each subtask but 
the user facing API doesn't deal in Thread objects. We are always on the 
look out for a better name but I don't think renaming this to include 
"Thread" in the name would work.

The interface in your first mail looks more like an Executor in that it 
forks something. Maybe there is useful abstraction hiding but STS is not 
something that you pass around, meaning you aren't going to invoke a 
method in a faraway library with your STS as a parameter.

-Alan

[1] 
https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/StructuredTaskScope.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20241007/2be96fbb/attachment.htm>


More information about the loom-dev mailing list