NightOwl888 commented on issue #1063: URL: https://github.com/apache/lucenenet/issues/1063#issuecomment-2539305263
> I prototyped a ValueAtomicInt64 and it worked, but it was too difficult to prevent accidental copying, especially when exposed outside the type like in MergePolicy.OneMerge. So I think our best bet is going to be to stick with AtomicInt64 for now. I'm also creating an AtomicDouble class to wrap those bit-converting operations to/from long. For `MergePolicy.OneMerge`, only the getter of the `EstimatedMergeBytes` property is public, so we can just return `estimatedMergeBytes.Value`. `totalMergeBytes` has only 3 callers and only 1 of them writes (in `IndexWriter`). Given that it is adding in a loop, we should call the `OneMerge.totalMergeBytes.AddAndGet(info.GetSizeInBytes())` method. The readers can just use `OneMerge.totalMergeBytes.Value`. We just need to leave some comments to explain why this changed from upstream (because we are lacking volatile for 64-bit). But this should be okay because we don't have a lot of callers and most of it is internal, anyway. -- 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: dev-unsubscr...@lucenenet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org