In visual studio, for example, one can freeze/thaw any thread at any time. Is is possible to do this programmatically in order to create a stress test of sorts for threaded code? If any thread could be frozen randomly for a random amount of time, it would really exercise the synchronization logic.
Share
You can do this with SuspendThread & ResumeThread, you’ll need the thread handle which you get by calling OpenThread. The thread functions page on msdn is a good resource for this sort of thing.