eirikbakke commented on PR #9303:
URL: https://github.com/apache/netbeans/pull/9303#issuecomment-4159135836

   I looked through the latest version. Splash.java still has various threading 
issues. For example:
   * SplashPainter.increment and SplashPainter.addToMaxSteps touches a bunch of 
fields from the main thread that are also accessed from the EDT in paint().
   * Splash.print, Splash.increment, and Splash.addToMaxSteps all access the 
non-volatile field "painter" from the main thread, but painter is assigned on 
the EDT.
   * SplashPainter.setText accesses the non-volatile field "text" from the main 
thread, but that field is accessed from the EDT in adjustText.
   * Splash.getComponent() is called from a thread other than the EDT and used 
as the parent of a dialog that is created off-thread.
   
   Threading issues have also clearly been an issue in the past, see e.g. the 
comment "run in AWT, there were problems with accessing font metrics". So if we 
touch threading at all we might need to do it properly...
   
   Some things that might help:
   * Making sure that all immutable fields have a "final" keyword, in 
particular in SplashPainter. (final fields will need to be initialized from a 
real constructor).
   * Adding a comment before each method and mutable field, indicating which 
thread is allowed to access them (main or EDT or both). Fields that can be 
accessed from either thread must be accessed through a synchronized block or 
other tread-safe mechanism (e.g. volatile reference to an immutable value).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to