473,387 Members | 1,834 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,387 software developers and data experts.

Loose Threads

Thank you all for all your help. My projects are chugging along now. I
have one more quick question, if you don't mind. I'm calling the WTS API
function WTSSessionEnumerate() multiple times on multiple worker threads
using asynchronous delegates and callbacks. Everything seems to work fine,
and I get the correct results returned. The problem is that every time I
stop the program, VS.NET tells me that between 3 and 10 of the worker
threads have not shut down? I call BeginInvoke() and EndInvoke(), and as I
said all the returned results are accurate. The worker threads don't appear
to be doing anything in the background, other than waiting to be shut down,
but this worker thing has me a little worried about possible future problems
when I run the app on other computers.

By the way, when I close the program, or if I hit a "Refresh" button that
restarts the asynchronous processing from scratch, VS.NET tells me again
that around 3 - 10 worker threads are shutting down. How do I force the
worker threads to shut down when I know they are completed processing? Is
there a function I can use to kill ALL worker threads I've started, to
ensure they all shut down properly?

Thanks again,
Michael C.
Nov 16 '05 #1
2 1323
Keep a variable reference to all threads you create, in an array if appropriate.
Nov 16 '05 #2
??

"Beeeeeves" <an*******@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
Keep a variable reference to all threads you create, in an array if

appropriate.
Nov 16 '05 #3

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

Similar topics

3
by: Ronan Viernes | last post by:
Hi, I have created a python script (see below) to count the maximum number of threads per process (by starting new threads continuously until it breaks). ###### #testThread.py import...
0
by: Al Tobey | last post by:
I was building perl 5.8.2 on RedHat Enterprise Linux 3.0 (AS) today and noticed that it included in it's ccflags "-DTHREADS_HAVE_PIDS." I am building with -Dusethreads. With newer Linux...
8
by: Chris Sharman | last post by:
I've got the following url (centre generated by cgi, and including banner, menus, etc designed by someone else) - http://services.ccagroup.co.uk/upbin/oformw?&whsmithwedding This looks as intended...
3
by: pieter.breed | last post by:
Hi All, It seems as if whenever you rebuild a .net class library you have to rebuild /everything/ which references it. Is this so? I am wondering what happens when you are only doing a minor...
6
by: m | last post by:
Hello, I have an application that processes thousands of files each day. The filenames and various related file information is retrieved, related filenames are associate and placed in a linked...
34
by: Kovan Akrei | last post by:
Hi, I would like to know how to reuse an object of a thread (if it is possible) in Csharp? I have the following program: using System; using System.Threading; using System.Collections; ...
10
by: [Yosi] | last post by:
I would like to know how threads behavior in .NET . When an application create 4 threads for example start all of them, the OS task manager will execute all 4 thread in deterministic order manes,...
3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
10
by: Darian | last post by:
Is there a way to find all the thread names that are running in a project? For example, if I have 5 threads T1, T2, T3, T4, T5...and T2, T4, and T5 are running...I want to be able to know that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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...
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
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
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...

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.