Friday, August 5, 2011

Relacy Race Detector 2.4 and more


It's been a long time since I blogged the last time. Since that I had joined Google, and was busy working on the ThreadSanitizer project, which is one the best race detectors out there (not saying that it's free and open source). Also I am actively contributing to the Go language concurrency/scalability related things, and it already starts paying off. The language has built-in support for concurrency and is very nice and simple to say the least of it. But any of that things requires a separate blog post.

OK, I've just uploaded Relacy Race Detector version 2.4, you may download it here.
+ Support for futex(FUTEX_WAIT/FUTEX_WAKE)
+ Linux/Darwin performance improved (2.5x for Linux, 7x for Darwin)
+ Fixed a bunch of issues with WaitForMultipleObjects()/SignalObjectAndWait()
+ Fixed rare spurious memory leak reports related to test progress reporting

The credit for the release goes to Charles Bloom - check out the blog, you may find a lot of interesting concurrency related stuff there.

The performance improvement is a result of an interesting optimization related to fiber/ucontext switching, and it deserves a separate post:

Also check out SPAA11 "Location-Based Memory Fences" paper that I co-authored.

P.S. Google office in Moscow is awesome, people and possibilities are even better. Do not hesitate to submit your CV now... and don't forget to indicate me as a referee :)


  1. Awesome, happy to see you're getting to tap into interesting problems at Google. Thanks for the status update.

  2. Also of interest (re: fibers), see

    There is also of literature in this area.

  3. Fantastic. Very happy to see you've landed at Google.

    (Also very happy for futex support in Relacy ;) thanks!)

  4. Awesome! Can you provide Makefiles for OSX + Linux for Relacy 2.4? I'm stuck getting this to compile with GCC...

  5. What is the problem with building? It's header-only library, it does not require a Makefile. I just include "/whatever_path/relacy/relacy.hpp" into a program, and then build as g++ myprog.cpp. That's all. Works for me on both Linux and OSX.

  6. 1. What is different between ThreadSanitizer and Relacy Race Detector? What are the benefits of ThreadSanitizer over RRD and vice versa?

    2. Is there any possibility to turn off RRD? Macros or something else? Unit tests need to use RRD, but production code must not.

  7. 1. ThreadSanitizer is intended for verification of large real-world applications, while RRD is intended for extremely careful verification of small tricky synchronization algorithms.

    2. Definitely. I had done that. It's actually quite easy if it's done on day one. The most annoying thing is annotations of declarations and usages of plain vars. Other than that it's quite straightforward, RRD refines RL_TEST macro when included, so you just need to do something along the lines:
    #ifndef RL_TEST
    # define VAR_T(x) x
    # define VAR(x) x

  8. What compiler are you using on OSX? Attempting to build any of the examples using i686-apple-darwin11-llvm-g++-4.2 on OSX 10.7.x doesn't get past the standard headers. Can you provide a command line to build? Thanks!

  9. I use standard g++ 4.2.1 installed with Xcode, and build as
    $ g++ source.cpp