Any command to kill thread. ? - Unix

This is a discussion on Any command to kill thread. ? - Unix ; provided i am owner of process , say for Ex. Process having 10 thread. Is there any command by which one can kill particular thread of th process ? currently i am doing some programming/debugging, some threads goes to infinte ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Any command to kill thread. ?

  1. Any command to kill thread. ?

    provided i am owner of process , say for Ex. Process having
    10 thread. Is there any command by which one can kill particular
    thread of th process ?

    currently i am doing some programming/debugging, some threads goes to
    infinte loop, i want to kill those threads without affecting other
    threads and the process. work, and they are at such a stage, if killed, not harming to other
    threads.>

    i know, i shoul correct the programming so it would not go to infinite
    loop...But just curious to know of any such command. ?

    -Raxit


  2. Re: Any command to kill thread. ?

    Sheth Raxit wrote:
    > provided i am owner of process , say for Ex. Process having
    > 10 thread. Is there any command by which one can kill particular
    > thread of th process ?
    >
    > currently i am doing some programming/debugging, some threads goes to
    > infinte loop, i want to kill those threads without affecting other
    > threads and the process. > work, and they are at such a stage, if killed, not harming to other
    > threads.>
    >
    > i know, i shoul correct the programming so it would not go to infinite
    > loop...But just curious to know of any such command. ?


    Since threads typically share resources (memory, mutexes etc), it would
    be a very bad idea to kill them at will.

  3. Re: Any command to kill thread. ?

    Gianni Mariani writes:
    > Sheth Raxit wrote:
    >> provided i am owner of process , say for Ex. Process having
    >> 10 thread. Is there any command by which one can kill particular
    >> thread of th process ?
    >> currently i am doing some programming/debugging, some threads goes to
    >> infinte loop, i want to kill those threads without affecting other
    >> threads and the process. >> work, and they are at such a stage, if killed, not harming to other
    >> threads.>
    >> i know, i shoul correct the programming so it would not go to
    >> infinite
    >> loop...But just curious to know of any such command. ?

    >
    > Since threads typically share resources (memory, mutexes etc), it
    > would be a very bad idea to kill them at will.


    The sharing isn't the problem per se. But there are resources, which
    can become owned by a specific thread (eg locked mutexes) and without
    some kind of interaction with this thread, it is not possible to
    determine if it currently owns some resources that may be needed by
    other threads later on (this is the usual reason why 'asynchronous
    cancelling' is considered to be a bad thing).

  4. Re: Any command to kill thread. ?

    On Oct 24, 5:26 am, Sheth Raxit wrote:
    > provided i am owner of process , say for Ex. Process having
    > 10 thread. Is there any command by which one can kill particular
    > thread of th process ?
    >
    > currently i am doing some programming/debugging, some threads goes to
    > infinte loop, i want to kill those threads without affecting other
    > threads and the process. > work, and they are at such a stage, if killed, not harming to other
    > threads.>
    >
    > i know, i shoul correct the programming so it would not go to infinite
    > loop...But just curious to know of any such command. ?


    This is a FAQ. With the cooperation of the thread, you can do this any
    way you would like. Without the cooperation of the thread, you cannot
    do this.

    DS


  5. Re: Any command to kill thread. ?

    Sheth Raxit wrote:
    > provided i am owner of process , say for Ex. Process having
    > 10 thread. Is there any command by which one can kill particular
    > thread of th process ?
    >
    > currently i am doing some programming/debugging, some threads goes to
    > infinte loop, i want to kill those threads without affecting other
    > threads and the process. > work, and they are at such a stage, if killed, not harming to other
    > threads.>
    >
    > i know, i shoul correct the programming so it would not go to infinite
    > loop...But just curious to know of any such command. ?
    >
    > -Raxit
    >


    Attach a debugger or write the code into the program. From another process you
    don't have thread level control.


+ Reply to Thread