Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is great, is there a "loom" like library for C++? I have a set of lock-free data structures that I would like to test.


Yes, the (IMHO) the easiest one to use is the Relacy Race Detector (https://github.com/dvyukov/relacy and https://www.1024cores.net/home/relacy-race-detector)

It's been around a while and is easy to work with. Written by Dmitry Vyukov, an expert in the concurrency world.


Relacy is notable for being the only one in c++ that knows what a fence is, at least last time I looked.

It told me a structure might not make forward progress on some thread interleaving. I.e. if only one thread ever runs, the others don't do anything. That's true but uninformative. I wasn't able to coax it into using a vaguely fair scheduler to get more useful information out than that.


32 bit only, no clang support :(


I think he implemented this inside Go


Folly has DeterministicSchedule, which also wraps atomics and it is used to test its core synchronization primitives, but I don't think it's as sophisticated as loom.

https://github.com/facebook/folly/blob/main/folly/test/Deter...





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: