Unix Programming - Any command to kill thread. ?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > October 2007 > Any command to kill thread. ?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Any command to kill thread. ?
Sheth Raxit

2007-10-24, 7:31 am

provided i am owner of process <or root>, 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. <logically each thread is doing individual
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

Gianni Mariani

2007-10-24, 1:33 pm

Sheth Raxit wrote:
> provided i am owner of process <or root>, 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. <logically each thread is doing individual
> 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.
Rainer Weikusat

2007-10-24, 1:33 pm

Gianni Mariani <gi4nospam@marian.ws> writes:
> Sheth Raxit wrote:
>
> 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).
Golden California Girls

2007-10-24, 1:33 pm

Sheth Raxit wrote:
> provided i am owner of process <or root>, 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. <logically each thread is doing individual
> 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.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com