Re: Thought experiment: constructing Nodes on a different thread...

2024-01-25 Thread John Hendrikx
Thanks, it seems I misunderstood something fundamental here. I always figured the memory effects are limited to the variables accessed/mutated within a synchronized block (or *could* be limited to just those by selectively flushing data by some advanced VM).  Apparently that's not the case, an

Re: Thought experiment: constructing Nodes on a different thread...

2024-01-25 Thread Kevin Rushforth
Yes, I think you are missing something. Unless you have an animation that just decides all on it's own to find and attach a newly discovered node to the scene and start rendering it, there will be a synchronization as a result of calling runLater. Consider the following code:     Label label

Re: Thought experiment: constructing Nodes on a different thread...

2024-01-25 Thread Nir Lisker
Isn't that exactly what the Worker interface and its Task and Service implementations are for? Service says A Service is a non-visual component encapsulating the information required > to perform some work on one or more background threads. As part of the > JavaFX UI library, the Service knows abo