A tool to unleash thread synchronization?

I recently worked on a multi-threaded program that has extremely complex blocking invariants. I was hoping to check that there are no deadlocks or races in the program, but a typical unit test may not show this because thread timings may happen so that the test passes even if an error exists in the code.

I was curious if there was a tool there to fiddle with timings so that the test can be run several times, each time with different threads, getting different time fragments in different orders. Is there such a tool? Or is there another good tool that can facilitate debugging?

This program is written in C, but I will answer in any language, since I am mostly curious about what's there, even if it is not directly applicable here.

+6
multithreading testing
source share
2 answers

If you are using the Windows platform, Microsoft Research has its own CHESS project , which currently only supports VS2008.

+3
source share

Check out the Helgrind tool built on Valgrind. This seems to be pretty legible, with the gcc versions it works with, but it's worth a look.

+4
source share

All Articles