Saturday, December 03, 2005

SuspendThread

as the msdn says SuspendThread is for debugging purposes and should not be used.
it may be tempting to use it to pause a worker thread for example but it might not be ok.
the worker thread can be in the middle of executing a CRT function which is thread safe, using sychronization.
if the worker thread is paused after the lock is done, trying to execute from another thread a CRT function, which uses the same syncronization access, might get to a deadlock.

No comments: