Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: code executed at end of a thread

by dk (Chaplain)
on Dec 04, 2009 at 14:59 UTC ( [id://811105]=note: print w/replies, xml ) Need Help??


in reply to Re: code executed at end of a thread
in thread code executed at end of a thread

That's so far my best guess too - except that my design is that I'm writing a generic library, and don't have a control over what threads do, that's up to the programmers. I'd hate to impose an extra requirement, like "hey use my lib but also use a goto" (I personally don't mind goto at all, and use them too), but you get my drift...

I thought rather that I missed some obscure language feature, and am trying to reinvent a wheel.

Replies are listed 'Best First'.
Re^3: code executed at end of a thread
by zentara (Archbishop) on Dec 04, 2009 at 18:22 UTC
    .... well then, use the nested labeled loops, as i suggested..... that code is just a simple example to illustrate exacting thread control..... running threads on manual so to speak, rather than requireing a thread helper library like a queue......and goto's are such a clean hack, that everyone should have it in their toolkits, even if the bossman dosn't like them :-)

    ....you can start up threads and pass perl code strings to them, thru shared variables, and have them eval'd in the thread.....but then the ugliness of an exit call taking down the whole house of cards raises it's head..... i don't know what you are doing, but threads may not be what you are looking for....unless you are on win32..... bwahaha.... then i can't help

    ....but you may have a bigger design problem with module safety..... hows that for b*llsh*t ;-)


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku
      "unless i'm on 32"... year right :) I'm using threads to emulate a proper popen() on win32 that returns a handle that I can use in select() . Other than this, the advice above with END inside eval actually works for me just fine.

      thanks for a brainstorm!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found