killing a thread...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neel

    #1

    killing a thread...

    Is there any way to kill any pthread ???
    I have two threads running and I wanna kill one thread from another
    thread.
    I donno understand what value to use for 2nd parameter to use
    pthread_kill...
  • Ian Collins

    #2
    Re: killing a thread...

    Neel wrote:
    Is there any way to kill any pthread ???
    I have two threads running and I wanna kill one thread from another
    thread.
    I donno understand what value to use for 2nd parameter to use
    pthread_kill...
    comp.programmin g.threads is the place to ask.

    Nine times out of ten wanting (I assume that's what "wanna" means) to
    kill a thread is a design smell.

    --
    Ian Collins.

    Comment

    • Gianni Mariani

      #3
      Re: killing a thread...

      Neel wrote:
      Is there any way to kill any pthread ???
      I have two threads running and I wanna kill one thread from another
      thread.
      I donno understand what value to use for 2nd parameter to use
      pthread_kill...
      Two options:

      a) place the other thread in a separate process.
      b) don't kill the other thread but instrument the code to have a "get
      out quick" flag.

      Other than those there are some pthread specific things but I would
      steer away from them.

      Comment

      Working...