1. 19

  2. 4

    Might help with playing around with lock/wait-free algorithms, too. People often say they’re easier to implement if a GC is present.

    1. 4

      Unless your lock/wait-free data structure must have strong reference cycles, you’d likely be better off using Arc. As mentioned in the article, though, something like this could be a nice off-the-shelf solution for cases where you really need tracing GC. It would be nice to eventually have both single-threaded and multi-threaded variants, so that you can take advantage of the reduced overhead in single-threaded contexts.

      I look forward to reading the rest of this series!

      1. 4

        Reference counting in concurrent code is a recipe for cache line ping-pong.

        1. 1

          Fair point. I guess it depends on details of the data structure and use case. If there’s a lot of count churn, you might be better off with a tracing GC. Of course, you will also need to account for any latency requirements.

        2. 1

          Thanks for the tips!