Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^6: using many threads and conserving stack size

by danmcb (Monk)
on Nov 12, 2008 at 16:43 UTC ( [id://723209]=note: print w/replies, xml ) Need Help??


in reply to Re^5: using many threads and conserving stack size
in thread using many threads and conserving stack size

yes, that makes sense. Awwww, now I have thread-guilt!

What doesn't make sense is that if you detach a thread, it gets stomped on when the main thread ends. AFAIK there is no way to say "I don't care what value it returns, but I DO want it to actually get there".

Guess I just want it all ...

Replies are listed 'Best First'.
Re^7: using many threads and conserving stack size
by gone2015 (Deacon) on Nov 12, 2008 at 17:08 UTC

    Well, if you want to be sure a thread has finished, in a sense you need to know the final report has been completed -- you're just not going to read it.

    The polite thing to do is to wait for the report, collect it, but wait at least until the thread has left your office before tossing the report in the bin.

    I look at it this way: when the mother thread terminates the system could wait for all the child threads to finish before knocking the process on the head. But it cannot know that the main thread has terminated cleanly, so the children may be on its hands forever waiting for their dead mother, taking up space, demanding attention, needing to be changed, etc. So the system promptly shoot them -- it's a hard world, with no room for motherless threads.

    I suppose mother could somehow promise the system that all the children will leave soon, of their own accord. But, frankly, would you take the word of a delinquent mother ? As if !

      Then the State should come along and collect the motherless child threads and put them in a home, where they can do no damage to themselves or others until of age, or at least until a foster process can come along and be attentive.

      The idea of a foster process has me thinking..hmm...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://723209]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found