On Sat, 20 Jan 2024 14:07:32 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> I'm not familiar enough with AtomicReference to have an opinion on this. >> Someone else will have to weigh in on this. > > Either an array or an AtomicReference is OK in this case. AtomicReference is > thread-safe, but that's not a concern here, since using `runAndWait` ensures > that writing to the array happens before reading it. I might be wrong, but array would need to store its size (an int, 8 bytes on 64 bit machines) in addition to the pointers themselves, while AtomicReference needs just the pointer. Plus, its semantics is much cleaner. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1337#discussion_r1462053392