Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How fibers can exist in Java [closed]

I know that my question is more academic than a real issue. In most cases a thread implementation with Fiber-like logic would be OK. But is there any way to implement Fibers as they are described in the JVM?

Is there any framework that is missing me to achieve that?

like image 208
Evan P Avatar asked Oct 22 '22 22:10

Evan P


1 Answers

There were/are Java EE frameworks, that enable to have a class with normal control flow like a Java SE application, and thus maintain state. To function over HTTP at specific points the classes instance is serialized, a response is made to the client, and on the next request the instance is deserialized and continues. This is not a general purpose coroutine solution, and I would certainly not call fibers.

Unfortunately its name slips my mind. But that was a specific case of running one single coroutine transfering control to the framework coroutine.

AOP offers another mean to switch control. Could maybe be used to implement fibers.

like image 81
Joop Eggen Avatar answered Oct 24 '22 17:10

Joop Eggen