DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    nick Guest

    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

  2. #2
    Paul Clapham Guest

    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




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links