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

enumerate threads

Is there such a thing as a collection of running
threads? I have an app which creates new threads and
assigns them a name. Periodically, I need to check
the .Name of all running threads to see if a particular
thread is already running to prevent starting that same
thread again. If not a collection, how can I easily
determine all of the threads which are running?

Thanks in advance,
Mark
Nov 19 '05 #1
3 3268
"Mark" <ma**********@sbcglobal.net> schrieb
Is there such a thing as a collection of running
threads? I have an app which creates new threads and
assigns them a name. Periodically, I need to check
the .Name of all running threads to see if a particular
thread is already running to prevent starting that same
thread again. If not a collection, how can I easily
determine all of the threads which are running?


System.Diagnostics.Process.GetCurrentProcess.Threa ds
--
Armin
Nov 19 '05 #2
Thanks!
-----Original Message-----
"Mark" <ma**********@sbcglobal.net> schrieb
Is there such a thing as a collection of running
threads? I have an app which creates new threads and
assigns them a name. Periodically, I need to check
the .Name of all running threads to see if a particular thread is already running to prevent starting that same thread again. If not a collection, how can I easily
determine all of the threads which are running?


System.Diagnostics.Process.GetCurrentProcess.Thre ads
--
Armin
.

Nov 19 '05 #3
Thanks. You read my mind. I was considering going this
route if there was no other way.

Mark
-----Original Message-----
How about to make list of your threads by yourself. I mean that, in exampleyou put your thread names into arraylist allways your create new thread andwhen the thread finishes you take it off from list. when the names are inlist you can easily check if thread is running.

Ville Pirhonen

"Mark" <ma**********@sbcglobal.net> wrote in message
news:06****************************@phx.gbl...
Is there such a thing as a collection of running
threads? I have an app which creates new threads and
assigns them a name. Periodically, I need to check
the .Name of all running threads to see if a particular
thread is already running to prevent starting that same
thread again. If not a collection, how can I easily
determine all of the threads which are running?

Thanks in advance,
Mark

.

Nov 19 '05 #4

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

Similar topics

5
by: Pekka Niiranen | last post by:
Hi, I have Perl code looping thru lines in the file: line: while (<INFILE>) { ... $_ = do something ... if (/#START/) { # Start inner loop
5
by: HL | last post by:
Hi, I need to enumerate windows and find the sum of the rect of all the windows of a specific application. In C++, I use the APIs - 'EnumWindows , GetWindowRect and UnionRect to accomplish the...
1
by: smichr | last post by:
I see that there is a thread of a similar topic that was posted recently ( enumerate with a start index ) but thought I would start a new thread since what I am suggesting is a little different. ...
6
by: Gregory Petrosyan | last post by:
Hello! I have a question for the developer of enumerate(). Consider the following code: for x,y in coords(dots): print x, y When I want to iterate over enumerated sequence I expect this to...
2
by: eight02645999 | last post by:
hi, i am using python 2.1. Can i use the code below to simulate the enumerate() function in 2.3? If not, how to simulate in 2.1? thanks from __future__ import generators def...
8
by: Dustan | last post by:
Can I make enumerate(myObject) act differently? class A(object): def __getitem__(self, item): if item 0: return self.sequence elif item < 0: return self.sequence elif item == 0: raise...
21
by: James Stroud | last post by:
I think that it would be handy for enumerate to behave as such: def enumerate(itrbl, start=0, step=1): i = start for it in itrbl: yield (i, it) i += step This allows much more flexibility...
12
by: Danny Colligan | last post by:
In the following code snippet, I attempt to assign 10 to every index in the list a and fail because when I try to assign number to 10, number is a deep copy of the ith index (is this statement...
8
by: eight02645999 | last post by:
hi say i want to enumerate lines of a file eg for n,l in enumerate(open("file")): # print next line ie is there a way to print out the next line from current line using the above?. Or do i...
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?
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
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
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,...
0
isladogs
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...
0
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...

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.