You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2019/03/07 10:58:54 UTC

[GitHub] [tomcat] rainerjung commented on issue #145: Adding volatile keywords to member variables

rainerjung commented on issue #145: Adding volatile keywords to member variables
URL: https://github.com/apache/tomcat/pull/145#issuecomment-470482121
 
 
   My understanding always was, that reordering must obey as-if-serial semantics for any single thread. The complexity only kicks in when checking, whether effects of statements run by one thread are visible by another. The concrete example you discuss IMHO does not have any visibility problems, because the changes are inside a synchronized block. Changes done by thread T1 while holding any lock are visible by any other thread T2 provided that T1 releases the lock after the changes and T2 acquired it before accessing the changed data.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org