Coroutine questions

common1945 at tutanota.com common1945 at tutanota.com
Thu Mar 20 04:07:51 UTC 2025


I understand that Continuation API is not intended to be used directly, and may change at any time. And you are right the snapshot I mean serializing and resuming the stack frames, things like that. 

Thanks for the advice, and the information. I appreciate it.

Mar 19, 2025, 01:21 by alan.bateman at oracle.com:

> On 18/03/2025 16:39, > common1945 at tutanota.com>  wrote:
>
>> I am doing some experiments that will make use of        loom's Continuation with jdk22+. I know that I can achieve java        Continuation effect with following code. However, I have a few        questions:
>>
>> Is it possible to pass in arguments like Lua's          coroutine[1][2]?
>> Is it possible to yield/ return some values like          Lua's coroutine[1][2]?
>> Does the way to communicate between the          Continuation block i.e. Runnable and outside Runnable merely          be able to achieved by embedding e.g. BlockingQueue inside the          Runnable code block?
>> Is it possible to capture Continuation's snapshot          for later use?
>>
>
> I don't want to spoil your experiments but just to say that the    internal Continuation API that you found is not intended to be used    directly, isn't documented, and may change at any time. For Lua like    passing of parameters from resume to yield then you can extend    Continuation to add a field for the passed parameter.
>  
>  By snapshot I assume you mean being able to serialize and resume in    a different VM. There isn't any support for that.
>  
>  -Alan
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20250320/4c72cada/attachment.htm>


More information about the loom-dev mailing list