This task tracks exploring the implications of a custom scheduler that uses the AWT EventQueue dispatch thread as the (single) carrier thread, e.g.
Thread.builder().virtual(EventQueue::invokeLater).task(() -> { ... }).start();
Would it be feasible to create a "bouncing balls" application where each component is control by a virtual thread? Answering that might help tease out the challenges/issues. It may be that EventQueue. isDispatchThread() or its usages will need to be re-examined or maybe new APIs will be needed to allow the AWT implication test if the underlying thread is the EDT.
Thread.builder().virtual(EventQueue::invokeLater).task(() -> { ... }).start();
Would it be feasible to create a "bouncing balls" application where each component is control by a virtual thread? Answering that might help tease out the challenges/issues. It may be that EventQueue. isDispatchThread() or its usages will need to be re-examined or maybe new APIs will be needed to allow the AWT implication test if the underlying thread is the EDT.
- relates to
-
JDK-8268180 Explore using JavaFX Application Thread as carrier thread
- Open
-
JDK-8292041 Provides the Thread#startVirtualThread overloaded method
- Closed