Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Threads: How to kill a thread manually?

by Booger (Pilgrim)
on Apr 26, 2005 at 18:48 UTC ( #451725=note: print w/ replies, xml ) Need Help??


in reply to Threads: How to kill a thread manually?

I realize that this doesn't exactly answer your question, coldfate, but if you can do without threads in whatever it is that you're doing, do so. IMHO, threads are really too complicated for most solutions and defeat the KISS principle.

Then again, I could be just talking out of my ass.

(Seeing as how I've never actually had a reason to use them)


Comment on Re: Threads: How to kill a thread manually?
Re^2: Threads: How to kill a thread manually?
by coldfate (Initiate) on Apr 26, 2005 at 18:59 UTC
    Hmm that might be true. As Elian and BrowserUK pointed out, it seems like what I proposed was a bad idea. Ok, this is my problem.

    My perl program wants to access some data from an external program, B. In order to do so, I need to first run another external program, A, which is required for me to interact with B. A never dies. It continuously runs forever. So it seems like I cannot call:

    system(A);
    system(B);

    otherwise it'll hang on system(A). And it seems like creating 2 separate threads for both A and B and having a successful completion of B kill off A is also not good. Can someone suggest a third alternative to this problem?

    Thanks! coldfate

      If your program doesn't need to interact with program A, then you can detach it, retaining the pid. When your finished with program B, use kill to terminate program A.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco.
      Rule 1 has a caveat! -- Who broke the cabal?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-07-10 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (198 votes), past polls