Aravind-Suresh commented on issue #11207: URL: https://github.com/apache/pinot/issues/11207#issuecomment-1659480262
Yes it could be due to reordering of instructions / changes not flushed to main memory before the new thread starts (this flushing to main memory synchronously is done specifically for volatile variables). At least for final variables, Java guarantees this "flush" after the constructor returns. This particular section explains with an example the type of guarantees Java provides - http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#finalRight In any case it's better to not let "this" escape before the constructor returns to avoid undefined behavior. -- 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]
