John C. Turnbull
ozemale at ozemail.com.au
Wed Mar 6 15:45:56 PST 2013
Is there a document/link that describes in some detail the threading architecture of JavaFX along with things such as defining the "pulse" and the rendering pipeline?
From: openjfx-dev-bounces at openjdk.java.net [mailto:openjfx-dev-bounces at openjdk.java.net] On Behalf Of steve.x.northover at oracle.com
Sent: Thursday, 7 March 2013 04:49
To: openjfx-dev at openjdk.java.net
Subject: JavaFX Threading
One of the great things about JavaFX is that it has a consistent threading model that maps well on to the underlying platforms. There is a single distinguished GUI-thread that is also the GUI-thread for the window system. This makes JavaFX GUI behavior consistent and deterministic. In general, running code in the GUI thread is a good thing for these reasons and others, provided that the code is not long running. In the case of long running code, JavaFX objects may be created in background threads as long are they are not attached to the scene graph.
JavaFX applications have a life cycle that includes, construction, init(), start() and stop(). The start() method is the most important and runs in the GUI-thread. The init() method is guaranteed to run in a background thread and is the place where long running creation code can reside. The start() method will always run after init() has completed.
With a preloader, the start() of the preloader runs at the same time as the init() of the application. The stop() method is also guaranteed to run in the GUI-thread.
What about application construction?
Today, this is unspecified and happens in a background thread. We are considering moving this to the GUI-thread. Here is the JIRA that is tracking this work:
If you are interested, add yourself, please add yourself to it and comment either there or on this list,
More information about the openjfx-dev