Look into Microsoft's CHESS proejct which analyzes the code to quickly converge on error cases as well as a system by which thread interleaving is predictable and thus testable. It actually tests every possible combination of thread interleaving through a code path.