Multiple thread handle problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • anks

    Multiple thread handle problem

    hi

    I am starting a no.of threads(500) from my application. i want to
    start a new thread as soon as one of these threads dies.Any of the
    thread could die at any particular time.Currently i am using a loop
    to check which of the threads is alive and i can use join() for
    others.I don't want to use a loop as that is eating a lot of memory.

    Using synchronization method is it possible to block (creation of new
    thread) untill one of the current thread dies.

    Please help...

    Anks
  • hiwa

    #2
    Re: Multiple thread handle problem

    [email protected] m (anks) wrote in message news:<ab82cf41. 0312140546.4ac3 [email protected] ogle.com>...[color=blue]
    > hi
    >
    > I am starting a no.of threads(500) from my application. i want to
    > start a new thread as soon as one of these threads dies.Any of the
    > thread could die at any particular time.Currently i am using a loop
    > to check which of the threads is alive and i can use join() for
    > others.I don't want to use a loop as that is eating a lot of memory.
    >
    > Using synchronization method is it possible to block (creation of new
    > thread) untill one of the current thread dies.
    >
    > Please help...
    >
    > Anks[/color]

    Don't create thread directly. Make a thread pool as a singleton and
    let user who need new thread retrieve his thread from the pool.

    Comment

    Working...