How to kill a single thread from Terminal in Ubuntu?
I'm new to Ubuntu and new here. I need to know this.
How do I kill a single thread from Terminal in Ubuntu? I have mozilla opened and it has 45 threads. I want to kill one of it.
I've already search many sources online but to no avail. Can anyone help me?
23 Answers
You can't. Not without killing the whole process. From man 3 pthread_kill, a function used for signal handling:
NOTES Signal dispositions are process-wide: if a signal handler is installed, the handler will be invoked in the thread thread, but if the disposition of the signal is "stop", "continue", or "terminate", this action will affect the whole process.Also see this U&L post.
5This seems to be what tgkill is for, but it's unlikely the best way to deal with too many threads opened by application. It should be treated as a sort of debugging tool.
In terminal type:
kill -9 "pid number for the process"For example:
kill -9 5624 (number 9 is the code for kill signal)To get the PID number for the process either use:
ps -eLFor you could use the command:
topEvery process will have it's own PID number. The reason for this is because processes can be named the same.
3