Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils [v2]

2025-02-07 Thread Andy Goryachev
On Fri, 7 Feb 2025 18:03:41 GMT, Kevin Rushforth wrote: > Your solution is basically what I meant by option 2. right. "only one thread" threw me off, sorry. - PR Comment: https://git.openjdk.org/jfx/pull/1691#issuecomment-2643660437

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils [v2]

2025-02-07 Thread Kevin Rushforth
On Fri, 7 Feb 2025 17:55:28 GMT, Andy Goryachev wrote: > Hmmm, to further make a point: options 2 and 3 may not be re-entrant, so they > probably won't work. Your solution is basically what I meant by option 2. The way you did it, always using the return value of a method that will return a "s

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils [v2]

2025-02-07 Thread Andy Goryachev
On Fri, 7 Feb 2025 16:33:27 GMT, Andy Goryachev wrote: >> Thread-safe and re-entrant implementation of Utils. >> >> The new code still uses the static instances of Text and TextLayout for >> performance reasons, but adds a thread-safe mechanism to keep track of >> whether any of the instances

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils [v2]

2025-02-07 Thread Michael Strauß
On Fri, 7 Feb 2025 16:33:27 GMT, Andy Goryachev wrote: >> Thread-safe and re-entrant implementation of Utils. >> >> The new code still uses the static instances of Text and TextLayout for >> performance reasons, but adds a thread-safe mechanism to keep track of >> whether any of the instances

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils [v2]

2025-02-07 Thread Kevin Rushforth
On Fri, 7 Feb 2025 16:33:27 GMT, Andy Goryachev wrote: >> Thread-safe and re-entrant implementation of Utils. >> >> The new code still uses the static instances of Text and TextLayout for >> performance reasons, but adds a thread-safe mechanism to keep track of >> whether any of the instances

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils [v2]

2025-02-07 Thread Kevin Rushforth
On Fri, 7 Feb 2025 16:33:27 GMT, Andy Goryachev wrote: >> Thread-safe and re-entrant implementation of Utils. >> >> The new code still uses the static instances of Text and TextLayout for >> performance reasons, but adds a thread-safe mechanism to keep track of >> whether any of the instances

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils [v2]

2025-02-07 Thread Andy Goryachev
> Thread-safe and re-entrant implementation of Utils. > > The new code still uses the static instances of Text and TextLayout for > performance reasons, but adds a thread-safe mechanism to keep track of > whether any of the instances is in use and when that happens, supplies a new > instance in

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils

2025-02-07 Thread Andy Goryachev
On Thu, 6 Feb 2025 23:39:26 GMT, Kevin Rushforth wrote: >> Thread-safe and re-entrant implementation of Utils. >> >> The new code still uses the static instances of Text and TextLayout for >> performance reasons, but adds a thread-safe mechanism to keep track of >> whether any of the instances

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils

2025-02-07 Thread Andy Goryachev
On Fri, 7 Feb 2025 07:58:47 GMT, Michael Strauß wrote: > What's the rationale for using a borrow pattern here, instead of simply > synchronizing access to the object in question? A very good question! This pattern seemed to be the most applicable here: the solution needs to be both thread-saf

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils

2025-02-06 Thread Kevin Rushforth
On Thu, 30 Jan 2025 23:35:05 GMT, Andy Goryachev wrote: > Thread-safe and re-entrant implementation of Utils. > > The new code still uses the static instances of Text and TextLayout for > performance reasons, but adds a thread-safe mechanism to keep track of > whether any of the instances is i

Re: RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils

2025-02-06 Thread Andy Goryachev
On Thu, 30 Jan 2025 23:35:05 GMT, Andy Goryachev wrote: > Thread-safe and re-entrant implementation of Utils. > > The new code still uses the static instances of Text and TextLayout for > performance reasons, but adds a thread-safe mechanism to keep track of > whether any of the instances is i

RFR: 8347392: Thread-unsafe implementation of c.s.j.scene.control.skin.Utils

2025-02-05 Thread Andy Goryachev
Thread-safe and re-entrant implementation of Utils. The new code still uses the static instances of Text and TextLayout for performance reasons, but adds a thread-safe mechanism to keep track of whether any of the instances is in use and when that happens, supplies a new instance instead. This