You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/07/21 09:17:38 UTC

[GitHub] [zookeeper] symat commented on pull request #1402: ZOOKEEPER-3889: Add volatile for variable finished in ReadOnlyRequestProcessor

symat commented on pull request #1402:
URL: https://github.com/apache/zookeeper/pull/1402#issuecomment-661739791


   Thanks @Technoboy- for the improvement!
   
   Actually the variable is accessed by multiple threads (e.g. the `run()` vs. the `shutdown()` methods). So adding the `volatile` would make sense. Usually I prefer to use the Atomic* objects more. But maybe for a simple boolean set/check the volatile is enough.
   
   But I don't really like these micro-commits, it's just too much administration :)
   Maybe @Technoboy- could you also check the other processors and look if you find other places where you can improve the shutdown mechanisms? Of course only if you have the time...


----------------------------------------------------------------
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