07-31-2008
Not enough details.
A signal that terminates a single multithreaded process, as matrix notes, should terminate all threads.
That being said I don't know what the default result for SIGTERM is in your environment
Signals and threads are always a problem. If there is a way to avoid this kind of situation I'd suggest trying hard to do it.
What it sounds like (naively) is that you need to ignore all signals in tracker and workers and use thread conditionals (events)..for pthreads: man -k pthread_cond.
Last edited by ramen_noodle; 07-31-2008 at 03:16 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi All,
I am unable to kill a process using kill command. I am using HP-UX system. I have tried with kill -9 and i have root privilages.
How can i terminate this daemon ? ? ?
Regards,
Vijay Hegde (3 Replies)
Discussion started by: VijayHegde
3 Replies
2. UNIX for Advanced & Expert Users
Any idea how to kill threads (not processes) in solaris?
I had checked the man pages for both kill and pkill to no avail. (9 Replies)
Discussion started by: izy100
9 Replies
3. Programming
Hi all
i have simple c program , when i wish to kill the app
im using kill(0,-9) , but it seams this command don't do any thing and the program.
just ignore it .
what im doing wrong here ?
im using HP-UX ia64
Thanks (9 Replies)
Discussion started by: umen
9 Replies
4. Shell Programming and Scripting
Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies
5. Linux
I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies
6. UNIX for Dummies Questions & Answers
Hey guys,
Just wondering is there anyway that I would be able to run a detached process that would continue to run regardless of me being logged into the linux host? (4 Replies)
Discussion started by: killaram
4 Replies
7. Programming
I have a simple client/server program I am using for learning purposes.
I have it setup so that after server is setup and listening it than goes into a loop where it accepts incoming client connections. After each connection, the client socket is than passed to a thread routine where it can be... (3 Replies)
Discussion started by: Majortom71
3 Replies
8. Shell Programming and Scripting
Good afternoon
I need to KILL a process in a single command sentence, for example:
kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'`
That sentence Kills the process ID corresponding to the program CAL255.4ge.
However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies
9. Shell Programming and Scripting
My ksh version is ksh93-
=>rpm -qa | grep ksh
ksh-20100621-3.fc13.i686
I have a simple script which is as below - #cat test_sigterm.sh -
#!/bin/ksh
trap 'echo "removing"' QUIT
while read line
do
sleep 20
done
I am Executing the script From Terminal 1 - 1. The ksh is started... (3 Replies)
Discussion started by: rpoornar
3 Replies
10. UNIX for Advanced & Expert Users
I would like to know is there any we can kill a single thread among multiple threads belongs to process?
Since Signal action is process wise not per thread, i strongly feel that we can not or for that mater from external sources as well single thread can not be killed which is critical section... (2 Replies)
Discussion started by: murali242512
2 Replies
NPTL(7) Linux Programmer's Manual NPTL(7)
NAME
nptl - Native POSIX Threads Library
DESCRIPTION
NPTL (Native POSIX Threads Library) is the GNU C library POSIX threads implementation that is used on modern Linux systems.
NPTL and signals
NPTL makes internal use of the first two real-time signals (signal numbers 32 and 33). One of these signals is used to support thread can-
cellation and POSIX timers (see timer_create(2)); the other is used as part of a mechanism that ensures all threads in a process always
have the same UIDs and GIDs, as required by POSIX. These signals cannot be used in applications.
To prevent accidental use of these signals in applications, which might interfere with the operation of the NPTL implementation, various
glibc library functions and system call wrapper functions attempt to hide these signals from applications, as follows:
* SIGRTMIN is defined with the value 34 (rather than 32).
* The sigwaitinfo(2), sigtimedwait(2), and sigwait(3) interfaces silently ignore requests to wait for these two signals if they are speci-
fied in the signal set argument of these calls.
* The sigprocmask(2) and pthread_sigmask(3) interfaces silently ignore attempts to block these two signals.
* The sigaction(2), pthread_kill(3), and pthread_sigqueue(3) interfaces fail with the error EINVAL (indicating an invalid signal number)
if these signals are specified.
* sigfillset(3) does not include these two signals when it creates a full signal set.
NPTL and process credential changes
At the Linux kernel level, credentials (user and group IDs) are a per-thread attribute. However, POSIX requires that all of the POSIX
threads in a process have the same credentials. To accommodate this requirement, the NPTL implementation wraps all of the system calls
that change process credentials with functions that, in addition to invoking the underlying system call, arrange for all other threads in
the process to also change their credentials.
The implementation of each of these system calls involves the use of a real-time signal that is sent (using tgkill(2)) to each of the other
threads that must change its credentials. Before sending these signals, the thread that is changing credentials saves the new creden-
tial(s) and records the system call being employed in a global buffer. A signal handler in the receiving thread(s) fetches this informa-
tion and then uses the same system call to change its credentials.
Wrapper functions employing this technique are provided for setgid(2), setuid(2), setegid(2), seteuid(2), setregid(2), setreuid(2), setres-
gid(2), setresuid(2), and setgroups(2).
CONFORMING TO
For details of the conformance of NPTL to the POSIX standard, see pthreads(7).
NOTES
POSIX says that any thread in any process with access to the memory containing a process-shared (PTHREAD_PROCESS_SHARED) mutex can operate
on that mutex. However, on 64-bit x86 systems, the mutex definition for x86-64 is incompatible with the mutex definition for i386, meaning
that 32-bit and 64-bit binaries can't share mutexes on x86-64 systems.
SEE ALSO
credentials(7), pthreads(7), signal(7), standards(7)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
Linux 2015-08-08 NPTL(7)