Is there any way to wait for the rendering thread to settle and
process the commands produced by the app thread?
No guaranteed way that I know of; we run into a similar issue with our
robot-based unit tests. Using an AnimationTimer and waiting for a few
frames might work, but it sounds like you tried that?
Using the Preloader
Mike Hearn wrote:
As long as you are doing any of the "heavy lifting" on the FX
application thread it will necessarily starve the rendering, since
the application thread is where animation is run and rendering is
triggered. Applications are encouraged to do computationally
expensive tasks or tasks that are subject to blocking (e.g.,
network reads) on a different thread.
Yes, unfortunately one of the heavy tasks is FXMLLoader.load which
hits the threading issues I emailed about earlier.
But I'm not sure I really understand this. I'm OK with my (non
interactive) splash being hung whilst the app thread goes off and do
other things, as long as it was able to draw at least one frame to the
screen. Is there any way to wait for the rendering thread to settle
and process the commands produced by the app thread?