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.
multithreading testing
templatetypedef
source share