473,809 Members | 2,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Thread.Resume

Tam
Hi group,

Just downloaded the new Visual Studio 2005 (well new to me seeing as i
was previously using 2003).

My problem/question is that my Thread.Resume statements in an
application I've created has been depracted and I'm having trouble
finding what I should use instead.

Help?

Regards

Tam

Nov 5 '06 #1
4 2124
On 5 Nov 2006 10:05:55 -0800, "Tam" <ta*******@yaho o.comwrote:
>Hi group,

Just downloaded the new Visual Studio 2005 (well new to me seeing as i
was previously using 2003).

My problem/question is that my Thread.Resume statements in an
application I've created has been depracted and I'm having trouble
finding what I should use instead.

Help?

Regards

Tam
According to
http://msdn2.microsoft.com/en-us/net...stem.Threading

"Thread.Res ume has been deprecated. Please use other classes in
System.Threadin g, such as Monitor, Mutex, Event, and Semaphore, to
synchronize Threads or protect resources."

rossum

Nov 5 '06 #2
Tam <ta*******@yaho o.comwrote:
Just downloaded the new Visual Studio 2005 (well new to me seeing as i
was previously using 2003).

My problem/question is that my Thread.Resume statements in an
application I've created has been depracted and I'm having trouble
finding what I should use instead.

Help?
Rather than using Suspend/Resume, using an Auto/ManualResetEven t or
Monitor.Wait/Pulse/PulseAll. This is a much more orderly way of
working.

See http://www.pobox.com/~skeet/csharp/t...eadlocks.shtml and
http://www.yoda.arachsys.com/csharp/...thandles.shtml

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 5 '06 #3
Tam
Thankyou Jon... exactly what I needed to know/was looking for.

Sorry it took me a couple of days to recheck back here, just had a new
baby boy delivered to the world... there are now *two* (count em, two)
Thomas Inglis's in this world.

Again, many thanks.

Tam

Jon wrote:
Tam <ta*******@yaho o.comwrote:
Just downloaded the new Visual Studio 2005 (well new to me seeing as i
was previously using 2003).

My problem/question is that my Thread.Resume statements in an
application I've created has been depracted and I'm having trouble
finding what I should use instead.

Help?

Rather than using Suspend/Resume, using an Auto/ManualResetEven t or
Monitor.Wait/Pulse/PulseAll. This is a much more orderly way of
working.

See http://www.pobox.com/~skeet/csharp/t...eadlocks.shtml and
http://www.yoda.arachsys.com/csharp/...thandles.shtml

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 7 '06 #4
Tam <ta*******@yaho o.comwrote:
Thankyou Jon... exactly what I needed to know/was looking for.

Sorry it took me a couple of days to recheck back here, just had a new
baby boy delivered to the world... there are now *two* (count em, two)
Thomas Inglis's in this world.
Many congratulations :)

I think you'll find that it won't just be threads that are suspended
for a while now :)

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2124
by: kiplring | last post by:
Suppose a function which has Sleep() method in it. And I want to recycle it. I made two buttons which call "Resume()" and "Suspend()". But It doesn't work. The state of thread "t" will be "WaitSleepJoin" when it runs because the function it calls - "GenerateEvents()" has "Sleep()" function. Can I solve this problem with Thread? I don't want add nasty boll flags on it.
2
2304
by: Sakharam Phapale | last post by:
Hi All, In following example, while playing file, if thread goes in WaitSleepJoin state, due to Thread.Sleep method. Now I want to suspend thread by clicking on cmdSuspend button. I have written following code, which doesn't suspend it. Even I tried it by calling m_PlayThread.Interrupt() method which suspends the thread but cannot resume it again by calling Resume method. Any kind help will be appreciated.
7
2699
by: Charles Law | last post by:
My first thought was to call WorkerThread.Suspend but the help cautions against this (for good reason) because the caller has no control over where the thread actually stops, and it might have a lock pending, for example. I want to be able to stop a thread temporarily, and then optionally resume it or stop it for good.
1
3000
by: alundi | last post by:
Greetings: I'd like to post this as a new thread to an article in microsoft.public.dotnet.languages.vb originally made by nevin and replied to by Alan Pretre back in December ("ThreadState == not in the enumeration"). Like nevin, I have a VB.NET multi-threaded application, and quite frequently, after my main application class will call Thread.Suspend() on the thread the ThreadState of the Suspended Thread will be a value of 96. From...
2
4317
by: juky | last post by:
Hi all, I have a loop in the thread checking for a particular service status, whenever the status changes to "stopped" a RaiseEvent is generated by thread and another function runs. At the same time the thread is suspended. When I try to resume it from the another function I have some problems. Thank you. Juky
2
1292
by: Alan T | last post by:
As the Suspend method is deprecated, what method can I use? What I want to do is when the user press the button "Cancel", it will prompt the user to confirm it he want to stop the process, I need to suspend the thread before the user choose "Yes" or "No". If he choose "Yes", I will call Thread.Abort() If he choose "No", I will call Thread.Resume().
5
2807
by: Alan T | last post by:
I will do several things in my thread: Copy a file to a location Update database record Read the file content Write the content to a log file If I call Thread.Abort(), it may be possible to stop at the middle of the something ?
6
10274
by: Buddy Home | last post by:
Hello, I want to understand whats the best way to write code to replace Thread.Suspend, Thread.Resume and Thread.Abort. I have lots of code calling these existing methods and want to minimize the risk of changing the code everywhere so here is what I think I could do, which is to create my own ThreadWrapper class which inherits from Thread and which has these three methods already defined but does it a different way and then my...
3
6062
by: =?Utf-8?B?TWFyayBDaGFubmluZw==?= | last post by:
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...
20
5546
by: cty0000 | last post by:
I have some question.. This is my first time to use thread.. Following code does not have error but two warring The warring is Warning 2 'System.Threading.Thread.Suspend()' is obsolete: 'Thread.Suspend has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202'
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10387
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.