On Mon, 3 Feb 2025 16:39:44 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> Yes, I know. I was pointing out the fact that the frequency of the jitter 
>> will increase as the number of background threads increases. Which I think 
>> is fine.
>
> Actually, in looking at this further, I wanted to suggest an alternative 
> approach. Rather than having each background thread poke the application 
> thread to run a test loop every 100 test loops of that background thread, you 
> might consider having one additional thread whose job it is to periodically 
> run a test loop on the app thread. With the current approach, it is likely 
> running an app thread loop far more often than wanted for two reasons:
> 
> 1. The background threads are (intentionally) free running rather than being 
> tied to a frame or even a small sleep
> 2. Each background thread independently fires an FX app pass every 100 
> passes, meaning that if there are 20 threads, it will effectively run every 5 
> passes of a background thread (every 100 passes will queue up 20 calls to run 
> a pass on the FX app thread)
> 
> Having a dedicated test thread for testing on the FX app thread would allow 
> to control its frequency independent of the background threads.
> 
> What do you think?

I like it.

Also, I think we may want to add a bit of randomness to the process - in the 
"jiggler" thread, as well as to tests themselves.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1690#discussion_r1939775820

Reply via email to