G
Guest
I have a code which registers all threads with a thread dump class. At
intervals this thread dump class will dump the stack trace of all threads.
As calling StackTrace(threadtoDump) from a different thread other than the
treadToDump the threadToDump must be suspended otherwise a
ThreadStateException gets thrown.
However under .NET 2.0 System.Threading.Thread.Suspend/Resume have been
marked as obsolete with reference to better methods of synchronisation. I
agree with the comment about synchronisation however I am not trying to
sychonise threads, I just need the thread in an ok state to run the
Stacktrace method.
Any suggestions to how this should be achieved.
intervals this thread dump class will dump the stack trace of all threads.
As calling StackTrace(threadtoDump) from a different thread other than the
treadToDump the threadToDump must be suspended otherwise a
ThreadStateException gets thrown.
However under .NET 2.0 System.Threading.Thread.Suspend/Resume have been
marked as obsolete with reference to better methods of synchronisation. I
agree with the comment about synchronisation however I am not trying to
sychonise threads, I just need the thread in an ok state to run the
Stacktrace method.
Any suggestions to how this should be achieved.