On Tue, 27 Aug 2024 14:42:58 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> modules/javafx.graphics/src/main/java/com/sun/glass/ui/mac/MacApplication.java >> line 81: >> >>> 79: thr.setName("JavaFX-KeepAlive"); >>> 80: thr.setDaemon(false); >>> 81: thr.start(); >> >> is it possible to reuse some other thread for this purpose? >> this may not be an issue when virtual threads take hold, but right now >> threads are precious native resource. > > No. The whole reason we are doing this is that there are no other non-daemon > threads. I updated the docs to make this more clear. Anyway, threads aren't > _that_ scarce as long as you don't create hundreds of them. > > Loosely related: This reminds me that `javafx.application.Application.launch` > does create an unnecessary thread (on all platforms). There is a > long-standing issue to get rid of it: > > [JDK-8090323](https://bugs.openjdk.org/browse/JDK-8090323): Consider > eliminating the JavaFX-Launcher Thread > > It isn't high priority, but would be good cleanup. thank you for clarification! never underestimate the happiness with which the app and library developers create new threads... ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1545#discussion_r1733039789