in reply to Re^4: In a multithreading Perl Code How to Exit one thread while outher thread keeps running ?
in thread In a multithreading Perl Code How to Exit one thread while outher thread keeps running ?

I've interpreted the problem as returning an exit status of 0 to the calling process, which is hard as long as you've got threads running, as a process consists of its threads, at least under Windows. I don't know if POSIX is different - at least POSIX threads share the same ID-space as processes, so the main thread might exit there and still leave other threads running, but I doubt that.

  • Comment on Re^5: In a multithreading Perl Code How to Exit one thread while outher thread keeps running ?

Replies are listed 'Best First'.
Re^6: In a multithreading Perl Code How to Exit one thread while outher thread keeps running ?
by cdarke (Prior) on Jul 06, 2009 at 14:14 UTC
    The POSIX model is that when the primary thread ("main") ends, so do all the others. Perl follows this model.
    In theory the Windows model should allow other threads to complete without the primary thread, but the C RTL is not implemented in this way: exiting the primary thread calls ExitProcess().
Re^6: In a multithreading Perl Code How to Exit one thread while outher thread keeps running ?
by unixmonster (Initiate) on Jul 07, 2009 at 12:47 UTC
    Fork ..... Yes this is what I am looking for. I got the solution. Thanks a lot everybody for all your help