I kick off a bunch of threads inside the ThreadPool. How do I know when
the thread is finished running?
Thanks. 3 1334
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.co m> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l... I kick off a bunch of threads inside the ThreadPool. How do I know when the thread is finished running?
Thanks.
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?
Hi,
Did you ever took a look at the Thread class in the MSDN ?
Thread.IsThread PoolThread
Btw, I made a mistake before, it;s Thread.ThreadSt ate 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.co m> wrote in message
news:%2******** ********@TK2MSF TNGP10.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? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 src file to
generate a python module.
My problem- is when i call the corresponding python functions (ie
which are actually calls of extension src file) in a multi-threaded
ptython program- i see either one of these two situations--
|
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 range(5): # start five threads passing i to each one
thread.start_new_thread(thrd,(i,))
|
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 the entire operation will run to completion even when the ThreadAbortException is thrown
Thanks
Jeff
|
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
thread from another, and I'm almost at the point of acquiescing but
curiosity leads me on.
Below is a procedure template that I wonder might guarantee behavior
during an abort, and I'd like to get some feedback in case it's just
plain nonsense.
|
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 server. Data is
sent and received over these connections using the asynchronous model.
The server is currently in beta testing. Sporadically over the course
of the day, I'll observe the thread count on the process (via perfmon)
start climbing....
| |
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 jobs and beeing able to
be
notified when each of these threads finished it's job.
|
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
thread, and has it do some
calculation, and on completion calls an event which main has += on.
Lets call this class, calcClass.
|
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 is the completion of the worker/child thread triggering the
execution of the main app thread. Shouldn't the main app thread remain
|
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 active even when the service reaches it Service
Timer Stop?
|
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 to
worker thread.
With the help of Reflector, I found that default implementation of
Stream.Read just use BeginInovke to get a IAsynResult.
ReadDelegate delegate2 = new ReadDelegate(this.Read);
... ...
|
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...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
| |
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
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |