473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Stopping threads

When all code is completed from a thread, do I need to explicitly stop the
thread or will it stop on it's own?

Thanks,

Dan Reber


Nov 15 '05 #1
1 2978
100
Hi Daniel,
The thread will *exit* when the the code it executes exit via *return*,
reaching the end, throwing exception, etc. If you mean *stop* like *exit* -
yes it will *exit* by its own when there is no more code to execute.

HTH
B\rgds
100

"Daniel Reber" <no****@nospam.com> wrote in message
news:us***************@TK2MSFTNGP10.phx.gbl...
When all code is completed from a thread, do I need to explicitly stop the
thread or will it stop on it's own?

Thanks,

Dan Reber

Nov 15 '05 #2

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

Similar topics

6
by: Fabiano Sidler | last post by:
Hello Newsgroup! In my Python script, I use the 'thread' module (not 'threading') and 'signal' simultaneously. All spawned threads execute 'pcapObject.loop(-1, callback)', which does not return....
7
by: python | last post by:
I have a script that downloads some webpages.The problem is that, sometimes, after I download few pages the script hangs( stops). (But sometimes it finishes in an excellent way ( to the end) and...
3
by: karl | last post by:
I have a windows service that creates a monitor thread which in turn creates 4 worker threads. Each thread is based upon a derived class (HL7Listener) of the TcpListener class. When running this...
12
by: VMI | last post by:
My Windows form has two buttons: "Start" and "Stop". How can I stop the form from doing whatever it is doing without closing the whole application? The "Stop" button would have to stop a process...
5
by: JSheble | last post by:
I have a service that upon startup it creates two threads: this.Batch = new ServiceThread(); this.Batch.FileSpec = "2*.XML"; this.tBatch = new Thread(new ThreadStart(this.Batch.WatchDir));...
4
by: MSDousti | last post by:
Hi I have written a VB .NET app, which uses several threads. I thought that when the user closes the main window (when MainForm.closed event occures, and I call application.exit) all running...
11
by: Steve | last post by:
I'm having a problem with my Thread usage and I think the general design of how I'm working with them. My UI class calls a method in another class that does a lot of work. That "worker" class...
2
by: amadeusz.jasak | last post by:
Hello, it is possible to stop all threads (application) from thread of application: App |-MainThread |-WebServer |-CmdListener # From this I want to stop App The sys.exit isn't working...
1
by: mclaugb | last post by:
Here is a simple piece of thread code. When i add the print (or other) function into the run method--the thread fails to stop after 2 seconds which the join(2) should ensure. I have a function...
4
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i have a main thread an another worker thread. The main Thread creates another thread and waits for the threads signal to continue the main thread. Everything works inside a ModalDialog and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.