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

Keeping track of threads

I am starting a thread in the usual way as follows:

Sub StartThread (ByVal CameraName as String)

Dim t As New Thread(AddressOf Frm1.GetPicture)
t.Name = "GetPicture" & CameraName
t.Start()

End Sub

This will be called at anytime and will be called many times. So I end up
with a number of threads running with the name of the order
GetPictureCamera1, GetPictureCamera2 etc.

Before starting the thread I have to be sure that the thread of the same
name isn't already running and this is where my problem is.

I can't do the usual threadstate because the reference t is only valid in
this routine whilst it starts.

I really want to be able to do:

Public t(n) As New Thread(AddressOf Frm1.GetPicture)

and then I could always have a global reference to t. But I can't do this.

So my question is, how do I keep track (other than a collection which
seems to often get out of step with reality) of all the threads in my
application?

I've tried System.Diagnostics and also Process.GetProcess but the only
reference I seem to have is the Name, which is not available in these
classes.

Thanks

-Jerry


Jun 19 '06 #1
0 760

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

Similar topics

6
by: Astra | last post by:
Hi All I've noticed on quite a few ASP sites that when they have a 'MyAccount' section they transfer the site to https and then when you have logged into your account successfully and gone back...
2
by: Sandman | last post by:
Just looking for suggestion on how to do this in my Web application. The goal is to keep track of what a user has and hasn't read and present him or her with new material I am currently doing...
1
by: Joshua Russell | last post by:
I'm writing some software that opens multiple instances of a single class in new threads. I need a way of keeping track of all these class instances in some kind of collection. I'm basicaly writing...
9
by: Alfred Taylor | last post by:
I'm testing the waters of n-tier development and I ran into a scenario that I'm not sure what the best solution would be. I have a Company object which contains a collection of contacts retrieved...
0
by: Utter Newbie | last post by:
I know we have access to log files and web statistics can be pulled from those. But the guy who wants it built was thinking we should keep track of every time a page is hit seperately in MS sql...
2
by: xzzy | last post by:
I need to create threads and monitor their status via Name = RowID. I thought a hashtable of threads would do it, but I cannot get it to work. Does anyone know of an article or code snippet I...
0
by: Joergen Bech | last post by:
Source: ------------ http://home1.inet.tele.dk/jbech/binaries/threadingtest.zip (25K) Scenario: --------------- Main form with two listboxes, a textbox, a button, and a trackbar. Clicking...
2
by: metaperl | last post by:
I'm actually taking Microsoft's 2779 and just finished a lab where we kept track of our changes to the database. However, I'm not happy with the scripts interface because it does not tell me the...
10
by: Karlo Lozovina | last post by:
Hi, what's the best way to keep track of user-made subclasses, and instances of those subclasses? I just need a pointer in a right direction... thanks. -- Karlo Lozovina -- Mosor
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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,...

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.