-
Dynamic naming of a variable...
Just need a quick answer I am probably just being stupid but...
if I want to create multiple threads and not have to name them individualy...
but have a loop to create them how can i make them have unique names.
if I have a variable that holds a string to name the threads and i try to
use that would it not name the thread the name of my variable that is holding
the string ? ex:
string Name = "Thread1";
while(true)
{
Thread **Name = new testThread(blah blah blah);
Name++;
} // How can i use the value of Name to give my threads names ?
Any help is appriciated,
Nick
-
Re: Dynamic naming of a variable...
They don't have to have names. Put them in an array, or a Vector if you
don't know how many there will be.
PC2
nick <kingn@abacusokc.com> wrote in message news:3a883319$1@news.devx.com...
>
> Just need a quick answer I am probably just being stupid but...
>
> if I want to create multiple threads and not have to name them
individualy...
> but have a loop to create them how can i make them have unique names.
>
> if I have a variable that holds a string to name the threads and i try to
> use that would it not name the thread the name of my variable that is
holding
> the string ? ex:
>
> string Name = "Thread1";
>
> while(true)
> {
> Thread **Name = new testThread(blah blah blah);
> Name++;
> } // How can i use the value of Name to give my threads names ?
>
> Any help is appriciated,
> Nick
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks