atris commented on issue #823: LUCENE-8939: Introduce Shared Count Early Termination In Parallel Search URL: https://github.com/apache/lucene-solr/pull/823#issuecomment-524385885 > The reason for that is since `AtomicInteger.get()` is not guaranteed to be thread safe, so that was a hack way to read the value safely. If you notice, we do increment the counter when a hit is collected. However, the specific location you are mentioning is just for reading without a lock -- do an `incrementAndGet`, then decrement the phantom increment that we just did Hmm, I am thinking if we should just use `getAcquire` instead of this ugly dance, since that would ensure that loads and stores are not reordered and thus serialized?
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
