Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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?

Replies are listed 'Best First'.
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:


    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://451725]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2018-05-24 02:32 GMT
Find Nodes?
    Voting Booth?