7 ms·
Would you say that Java's Loom[1] matches your definition of structured concurrency? [1]: https://www.javaadvent.com/2020/12/project-loom-and-structured-concur
by frankpf 5y ago
Would you say that Java's Loom[1] matches your definition of structured concurrency?
[1]: https://www.javaadvent.com/2020/12/project-loom-and-structured-concurrency.html https://www.javaadvent.com/2020/12/project-loom-and-structur...
- gavinhoward 5y agoAfter reading that post, I'm pretty sure that Project Loom only fits my definition of structured concurrency if it's used solely with the try-with-resources construct. However, if it is used that easy, then yes, absolutely, it fits my definition. Using the Executor class as a threadset might also make it fit my definition, but I think my opinion of my definition has changed in the two years since I wrote it. I may have to revisit it because I think it may be useful to only consider concurrency that has the same block structure as structured programming does, whereas my current definition allows for passing a threadset around as a first-class value. tl;dr: yes, it probably fits, but that might mean my definition need changing, except in the case of try-with-resources.
- papercrane 5y agoThe intent for the structured concurrency part of Loom is that you'd always use it with try-with-resources. The API is still developing so this link will break eventually, but the currently the basic API is in the StructuredTaskScope class. https://download.java.net/java/early_access/loom/docs/api/jdk.incubator.concurrent/jdk/incubator/concurrent/StructuredTaskScope.html https://download.java.net/java/early_access/loom/docs/api/jd...