On Tue, 25 Feb 2025 22:41:07 GMT, Doug Lea <d...@openjdk.org> wrote: >>> @sunmisc You are right that it would be nice if there were a way to >>> efficiently use getAndSet here because a failed reference CAS hits slow >>> paths that vary across GCs. But all of the ways I know to do this are much >>> worse. >> >> After a few days of benchmarks, I realized that you would be absolutely >> right. Although I thought if we separate the head (for deleting) and the >> tail (for inserting) there would be less contention. >> Even the fact that we can only modify the head (delete) in one thread >> without volatile does not help. >> Perhaps I have made a mistake somewhere in the implementation > > @sunmisc Thanks for independently trying alternatives. We both had reasons to > suspect that other mechanics might work out as well or better, but none seem > to.
@DougLea Final review completed! I've added a few more comments and suggestions but after that I think this is ready to go. Thanks for the great work on this, Doug! /cc @AlanBateman ------------- PR Comment: https://git.openjdk.org/jdk/pull/23702#issuecomment-2754373403