Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool for messing up thread timing?

I've been working on a multithreaded program recently that has extraordinarily complex locking invariants. I was hoping to check that there are no deadlocks or races possible in the program, but a typical unit test might not show this because the thread timings might just happen to work out in a way that causes the test to pass even though an error exists in the code.

I was curious if there is a tool out there to mess with threes timings in ways that allows a test to be run multiple times, each time with different threads getting different time slices in different orders. Does such a tool exist? Or is there another good tool out there that could make debugging easier?

This program is written in C, but I'll take answers in any language since I'm mostly curious what's out there, even if it's not directly applicable here.

like image 781
templatetypedef Avatar asked Mar 15 '11 09:03

templatetypedef


People also ask

What is a thread chaser tool?

Definition of thread chaser : a multiple point tool used typically as one of a set of four in a die head for cutting a screw thread.


2 Answers

Check out Helgrind a tool built on Valgrind. It seems to be rather picky on which gcc versions it works with, but it's worth a look.

like image 51
harald Avatar answered Sep 28 '22 10:09

harald


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

like image 43
Chris O Avatar answered Sep 28 '22 08:09

Chris O