Tools and methods are described herein for discovering race condition
errors in a software program. The errors are discovered by deliberately
causing a processor executing the test program to switch threads at
intervals other than normally scheduled by an operating system. The
thread switching is caused upon occurrence of selected events. The
intervals may be selected automatically or with user input. Furthermore,
thread switching may be caused during conditions more likely to cause
race condition errors. For example, thread switches may be caused between
threads that share control of a memory device or while the processor is
executing instructions related to synchronization tools (e.g. locks,
mutex, etc.).