What i think to understand is :
Coroutine can be suspended in a block like run() {
native_func();
Continuation.suspend();
}
because the stack when is suspended is out from native func.
instead if i call suspend inside a JNI c++ class the stack is not visible
from java so probably javaflow dont work.
I have another different question:
run(){
while(!stream.eof()){
data=read(stream);
process(data);
}.
stream is synchonized internally waiting until data is not empty.
My question is: normally in synchonized blocks the thread is blocked until
notify but inside a coroutine the class is instrumented for not blocking
the thread but just for suspending the coroutine until notify?
2018-01-20 18:12 GMT+01:00 Torsten Curdt <[email protected]>:
> Hey Cristian,
>
> you have to think of javaflow continuations of having multiple ways of
> running through the "run" function with different entry and exit points.
>
> What should/will work is:
>
> run() {
> native_func();
> Continuation.suspend();
> native_func();
> Continuation.suspend();
> }
>
> I am not quite sure what you are trying to do with your setup. Why
> callbacks in a continuation world?
> Keep in mind that the native code is not instrumented.
>
> cheers,
> Torsten
>