473,503 Members | 544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Thread Completion question

I kick off a bunch of threads inside the ThreadPool. How do I know when
the thread is finished running?

Thanks.
Nov 16 '05 #1
3 1329
Hi,

You have to keep a reference to the thread, then you can query
Thread.IsAlive or Therad.Status to know teh status of the thread
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Frank Rizzo" <no**@none.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
I kick off a bunch of threads inside the ThreadPool. How do I know when
the thread is finished running?

Thanks.

Nov 16 '05 #2
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You have to keep a reference to the thread, then you can query
Thread.IsAlive or Therad.Status to know teh status of the thread


How can I do it if the Thread is running in the ThreadPool?
Nov 16 '05 #3
Hi,

Did you ever took a look at the Thread class in the MSDN ?

Thread.IsThreadPoolThread

Btw, I made a mistake before, it;s Thread.ThreadState no Thread.Status

Sorry, I did not look into MSDN :)
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Frank Rizzo" <no**@none.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You have to keep a reference to the thread, then you can query
Thread.IsAlive or Therad.Status to know teh status of the thread


How can I do it if the Thread is running in the ThreadPool?

Nov 16 '05 #4

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

Similar topics

0
1040
by: kanji | last post by:
Hi I know this question has been posed quite a number of times - but I could did not find a suitable answer to my problem. I have created a C library and its corresponding Python/C extension...
15
1566
by: Valkyrie | last post by:
Refering to the following codes I found, there is nothing displayed in the console, may I ask why? def thrd(param): # the thread worker function print "Received",param import thread for i in...
4
2241
by: Jeff | last post by:
I am running a worker thread that manipulates some hardware setting every so often. My problem is that the hardware manipulation cannot be interrupted once it has started How can I ensure that...
2
2334
by: cottonviking | last post by:
Greetings, all! I've been pondering the pitfalls of aborting a secondary thread in a service app I'm writing (VB, fx v1.1). Everything I've read so far pretty much dissuades one from aborting one...
4
5415
by: Matthew Groch | last post by:
Hi all, I've got a server that handles a relatively high number of concurrent transactions (on the magnitude of 1000's per second). Client applications establish socket connections with the...
2
4695
by: objectref | last post by:
hi to all folks, i want to create the following senario: i have a T1 (Thread 1) that acts like http server that receives incoming requests. From that T1, i want to spawn from T1 to Tn thread...
6
1383
by: DaTurk | last post by:
Here's a quick question, say I have a class with a main routine, we'll just call it main. Main is on the "main" thread. Now lets have main creat an instance of another class, which creates a...
1
1737
by: Sanjay | last post by:
Hi All Have an app. On start up it creates a thread and goes to sleep. Either on termination or completion of the worker thread, it triggers the main app to start executing. Question Why...
5
2105
by: John A. Bailo | last post by:
From a Windows service (NET 2.0) I want to launch serveral threads in a for loop that invokes a method using: new Thread(delegate() { myMethod(248);}).Start(); Will those threads stay...
2
4416
by: Morgan Cheng | last post by:
By default, ThreadPool has 25 worker threads per CPU and 1000 IO threads for each process. I am wondering how CLR managed to allocate IO asynchronous tasks to IO thread and other asynchonous tasks...
0
7203
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,...
0
7087
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
7281
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,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6993
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
5579
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,...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.