By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,671 Members | 1,670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,671 IT Pros & Developers. It's quick & easy.

Thread is not user-suspended; it can not be resumed

P: n/a
I'm receiving the above mentioned error.The problem is:
"I suspend one thread.Another thread is resuming the first thread.Then I
added following code:Its in simple english
if(first thread is not suspended)
then sleep(100)
else
resume first Thread
After adding this code every thing is fine.
Its in C#.
So my question is When we suspend thread, is it suspended at that time only
or it take some time to suspend?
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Amratash" <am*******@knowsys.net> wrote in message
news:Oy**************@TK2MSFTNGP10.phx.gbl...
I'm receiving the above mentioned error.The problem is:
"I suspend one thread.Another thread is resuming the first thread.Then I
added following code:Its in simple english
if(first thread is not suspended)
then sleep(100)
else
resume first Thread
After adding this code every thing is fine.
Its in C#.
So my question is When we suspend thread, is it suspended at that time only or it take some time to suspend?
<snip from MSDN .NET >
Unlike Thread.Sleep, Thread.Suspend does not cause a thread to immediately
stop execution. The common language runtime must wait until the thread has
reached a safe point before it can suspend the thread.
....
When one thread calls Thread.Suspend on another thread, the call is a
_nonblocking_ call that causes the other thread to pause.
....
threadstate goes from
SuspendRequested
Suspended

</snip>

HTH

greetz

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.