473,507 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to cancel a thread that is in threadpool

Hi

I would like to cancel or abort the execution of a thread that has been added to the queue of the threadpool. It seems that once it has been added, I don't have any access or control over it. Any help is appreciated

Regards

A
Nov 20 '05 #1
2 3178
On 2004-04-10, Anon <an*******@discussions.microsoft.com> wrote:
Hi,

I would like to cancel or abort the execution of a thread that has been added to the queue of the threadpool. It seems that once it has been added, I don't have any access or control over it. Any help is appreciated.

Regards,

A


You can't... The most you can do with a thread pool thread is set a
flag that the thread has access to that tells it to abort.

The threadpool class is best uses with short lived jobs that don't
require much user interaction :) If you need better control of the
threading process, your much better off using a System.Threading.Thread
object.

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
An Ada exception is when a routine gets in trouble and says
'Beam me up, Scotty'.
Nov 20 '05 #2
On 2004-04-10, Anon <an*******@discussions.microsoft.com> wrote:
Hi,

I would like to cancel or abort the execution of a thread that has been added to the queue of the threadpool. It seems that once it has been added, I don't have any access or control over it. Any help is appreciated.

Regards,

A


You can't... The most you can do with a thread pool thread is set a
flag that the thread has access to that tells it to abort.

The threadpool class is best uses with short lived jobs that don't
require much user interaction :) If you need better control of the
threading process, your much better off using a System.Threading.Thread
object.

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
An Ada exception is when a routine gets in trouble and says
'Beam me up, Scotty'.
Nov 20 '05 #3

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

Similar topics

7
2838
by: David Sworder | last post by:
Hi, I'm developing an application that will support several thousand simultaneous connections on the server-side. I'm trying to maximize throughput. The client (WinForms) and server communicate...
9
20360
by: Drew | last post by:
I keep seeing this when I run my program in Visual Studio: The thread '<No Name>' (0x894) has exited with code 0 (0x0). What does this mean exactly? It doesn't seem to be causing a problem. ...
1
3951
by: Jeffrey Kingsley | last post by:
I would like to cancel a call to BeginInvoke of a delegate (i.e. kill the thread the call was made on). This would be done when a timeout occures for the waitone call to the WaitHandle object of...
2
4696
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...
10
8747
by: Lenn | last post by:
Hello, I have always used a certain design pattern for multithreaded Windows app; Start new worker thread from UI thread, use events to notify UI threads when something happens, update UI...
2
464
by: Anon | last post by:
Hi I would like to cancel or abort the execution of a thread that has been added to the queue of the threadpool. It seems that once it has been added, I don't have any access or control over it. ...
7
5882
by: Sin Jeong-hun | last post by:
Hi. I'm writing a Client/Multi-threaded Server program on Windows Vista. It worked fine on Windows Vista, but when the server ran on Windows XP, I/O operation has been aborted because of either...
4
2656
by: Simon | last post by:
Hi All, I'm currently developping something where I need to use threads. Here's the basic scenario. I have a WebService requests which need to launch a few threads and wait for them to complete...
34
2749
by: Creativ | last post by:
Why does Thread class not support IDisposable? It's creating quite some problem. Namely, it can exhaust the resource and you have not control over it.
7
1617
by: Curious | last post by:
On Jun 10, 3:32 am, <s...@dailycoding.comwrote: Thanks! I'll use thread pool.
0
7313
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
7372
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
7029
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
7481
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...
0
5619
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
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1537
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 ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
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.