Structured Concurrency yet again
Attila Kelemen
attila.kelemen85 at gmail.com
Wed May 10 20:18:08 UTC 2023
Talking about "not the last word": Are there plans to introduce some
better cancellation support? I mean something better than the current
thread interruption mechanism (even though it is considerably less
awkward with virtual threads). If so, are there any posts on the plans
somewhere?
Ron Pressler <ron.pressler at oracle.com> ezt írta (időpont: 2023. máj.
10., Sze, 21:37):
>
>
>
> > On 10 May 2023, at 12:34, Alan Bateman <alan.bateman at oracle.com> wrote:
> >> I would prefer to provide an API easier to use. I believe that having a method join() that takes a function that takes a stream is easier to use correctly.
> > We were down that road before when the prototype was based on ES.
>
> Exactly. Since we tried quite a few things and STS is expected to start Preview, I think we should let actual problems people encounter with the API inform its evolution (as was the case with ditching Future as fork’s return type), especially because SC is not quite mainstream yet. I think STS is a good API to preview because I find it to strike a nice balance between simplicity and flexibility; it’s neither too high-level nor too low-level. So I think it can teach us about how people may use SC in the field while actually being useful to them.
>
> We have ideas for other structured-concurrency APIs (e.g. stream-based) that could be provided in addition to STS to make some common cases even more pleasant, so it’s quite possible that STS will not be the last word the JDK says on the subject of structured concurrency.
>
> — Ron
>
More information about the loom-dev
mailing list