They do, don't they?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: They do, don't they?

  1. #1
    Paul Clapham Guest

    They do, don't they?


    Shahzad <shahzad73@hotmail.com> wrote in message
    news:390ffade$1@news.devx.com...
    >
    > Hello
    >
    > I want to know that is it possible that i create a thread and when

    thred
    > finishes its work it destroy and dispose off it self.
    > pls give me suggestion at my mail box
    > shahzad73@hotmail.com
    >
    >
    > Thank you
    > Shahzad
    > http://www.angelfire.com/ak/shahzad73/cv.html (My resume page)


    Doesn't a thread end automatically when the run() method returns? As far as
    destroying and disposing of, that's what the garbage collector does.




  2. #2
    Shahzad Guest

    Re: They do, don't they?



    Shahzad
    What i was doing that i create a thread and push it on a special object stack
    that i programmed. This object stack keep track of all the threads and keep
    checking whether it has finished its work. This object stack component is
    also a thread. When it detects that a thread has finished its work it destry
    and delete it from its stack. So if threads destry it self then it means
    that there is no need for the object stack. I just keep creating the thread
    and it will be destroyed form the memory when run() has finished. Actually
    my application creates a lot of threads and i have only one variable to hold
    them. So that is why i create stack and when i create a thread i push it
    on the stack.

    Shahzad



    "Paul Clapham" <pclapham@core-mark.com> wrote:
    >
    >Shahzad <shahzad73@hotmail.com> wrote in message
    >news:390ffade$1@news.devx.com...
    >>
    >> Hello
    >>
    >> I want to know that is it possible that i create a thread and when

    >thred
    >> finishes its work it destroy and dispose off it self.
    >> pls give me suggestion at my mail box
    >> shahzad73@hotmail.com
    >>
    >>
    >> Thank you
    >> Shahzad
    >> http://www.angelfire.com/ak/shahzad73/cv.html (My resume page)

    >
    >Doesn't a thread end automatically when the run() method returns? As far

    as
    >destroying and disposing of, that's what the garbage collector does.
    >
    >
    >



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center