473,396 Members | 2,121 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,396 software developers and data experts.

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 3174
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
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
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
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
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
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
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
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
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
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
by: Curious | last post by:
On Jun 10, 3:32 am, <s...@dailycoding.comwrote: Thanks! I'll use thread pool.
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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...
0
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,...

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.