Systems, methods, and computer-readable media supporting thread
abstraction in Java are provided. In some illustrative embodiments, a
system is provided that includes a Java execution flow class that
represents an execution flow context, an execution flow scheduler object
including a Java native execution flow activation method, a Java virtual
machine, a Java scheduler that executes on the Java virtual machine, and
a Java thread class that extends the execution flow class. The execution
flow class includes an execution flow execution method and a constructor
that creates an execution flow context. The Java thread class includes an
execution flow execution method that overrides the execution flow
execution method of the execution flow class. In this system, a thread
object including one or more instructions of a thread is instantiated
using a custom thread class that extends the Java thread class, the
constructor creates an execution flow context for the thread, and the
Java scheduler invokes the execution flow activation method to switch
from a currently executing execution flow context to the thread execution
flow context to execute the one or more instructions.