PC Review


Reply
Thread Tools Rate Thread

Calling Thread.Suspend and it's affect on the target thread...

 
 
Paul Tomlinson
Guest
Posts: n/a
 
      3rd Feb 2005
Quick question.

If i call Thread.suspend() on a thread does the thread which is being
suspended get any notification that it has been/is being suspended?

I am thinking i want the thread-to-be-suspended to log the fact that it is
being suspended.

Any ideas?


 
Reply With Quote
 
 
 
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      3rd Feb 2005

"Paul Tomlinson" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Quick question.
>
> If i call Thread.suspend() on a thread does the thread which is being
> suspended get any notification that it has been/is being suspended?
>
> I am thinking i want the thread-to-be-suspended to log the fact that it is
> being suspended.
>
> Any ideas?
>


I suggest you don't use Thread.Suspend/Thread.Resume:
1. Both methods are obsolete in v2.0
2. You have no idea what the thread your are suspending is doing when you
suspend it's execution. Using these services are a recipt for deadlocks or
corrupted state, as it can suspend a thread that holds a managed lock, or is
actually executing a type constructor.

Use appropriate synchronization mechanisms based on Monitor and/or
Waithandle.

Willy.


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestion about Thread.Suspend() and Thread.Resume() Robe Microsoft C# .NET 1 18th Jan 2010 09:27 PM
Thread.Suspend and Thread.Resume in Framework 2.0 Buddy Home Microsoft C# .NET 6 14th Dec 2006 08:47 PM
Thread.Suspend and Thread.Resume replacments? Grant Merwitz Microsoft Dot NET Framework Forms 2 12th Jan 2006 09:40 AM
thread.abort and thread.suspend am Microsoft C# .NET 1 2nd Sep 2005 01:46 PM
thread.abort and thread.suspend am Microsoft Dot NET Framework 2 2nd Sep 2005 10:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:41 PM.