RFR: 8322784: JFXPanel calls InputMethodRequests on wrong thread [v2]
Andy Goryachev
angorya at openjdk.org
Mon Jan 22 15:47:42 UTC 2024
On Sat, 20 Jan 2024 14:07:32 GMT, Kevin Rushforth <kcr at 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
More information about the openjfx-dev
mailing list