On Tue, 6 May 2025 19:20:04 GMT, Michael Strauß <mstra...@openjdk.org> wrote:
>> I see. The I suggest we enforce single-threaded nature of it: everything >> must happen in the FX Application Thread. I don't think it's a good idea to >> start synchronizing things in FX now all of a sudden. >> >> Any code that wants to access FX from a background thread must do so using a >> combination of `runLater` and a `CountDownLatch`. >> >> What do you think? > > That would be okay, except that `Scene` is allowed to be created on a > background thread (it's in the class documentation), so we can't completely > enforce it to be single-threaded. Once a scene is created, a user can also > request its preferences. This is when we need some way to get the current > platform preferences on a background thread, as otherwise users would > potentially see the scene preferences suddenly change once the scene is shown. That's why I am against this background thread nonsense. Create - yes (even though I am against this). Access and modify properties, especially those that interact with other parts of the FX - no. I think we should enforce the FX application thread access. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1655#discussion_r2076116995