ScopedValue structured forking/forwarding API
Pedro Lamarão
pedro.lamarao at prodist.com.br
Mon Jul 14 14:17:11 UTC 2025
Em dom., 13 de jul. de 2025 às 17:32, Nikita Bobko <
nikita.bobko at jetbrains.com> escreveu:
> Coroutines are not magical. Effectively, CPS-transformation slices
> suspend functions by their suspension points. And under layers of
> abstractions, kotlinx.coroutine still submits those slices to whatever
> thread by doing old and boring threadPool.submit().
>
IIRC, integration 2 requires merging values bound to the continuation with
values bound to the thread at each "resume" point and then provided to the
coroutine. Is this not the domain of the transformer or scheduler?
shouldn't this be implemented in that layer? This way, Kotlin would
guarantee structural integrity -- there would be no way for the user to
fail to satisfy runtime requirements. Proposals which require the user to
"close" bindings remove from the platform the surety of structural
integrity, requiring "checks" to be introduced at code paths meant to
be blazing fast.
--
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20250714/8d6e865d/attachment.htm>
More information about the loom-dev
mailing list