pthread_kill_other_threads_np(3) [redhat man page]
PTHREAD_KILL_OTHER_THREADS_NP(3) Library Functions Manual PTHREAD_KILL_OTHER_THREADS_NP(3)NAME
pthread_kill_other_threads_np - terminate all threads in program except calling thread
pthread_kill_other_threads_np is a non-portable LinuxThreads extension. It causes all threads in the program to terminate immediately,
except the calling thread which proceeds normally. It is intended to be called just before a thread calls one of the exec functions, e.g.
Termination of the other threads is not performed through pthread_cancel(3) and completely bypasses the cancellation mechanism. Hence, the
current settings for cancellation state and cancellation type are ignored, and the cleanup handlers are not executed in the terminated
Xavier Leroy <Xavier.Leroy@inria.fr>
SEE ALSO execve(2), pthread_setcancelstate(3), pthread_setcanceltype(3), pthread_cancel(3).
According to POSIX 1003.1c, a successful exec* in one of the threads should terminate automatically all other threads in the program. This
behavior is not yet implemented in LinuxThreads. Calling pthread_kill_other_threads_np before exec* achieves much of the same behavior,
except that if exec* ultimately fails, then all other threads are already killed.
Check Out this Related Man Page
PTHREAD_KILL_OTHER_THREADS_NP(3) Linux Programmer's Manual PTHREAD_KILL_OTHER_THREADS_NP(3)NAME
pthread_kill_other_threads_np - terminate all other threads in process
pthread_kill_other_threads_np() only has an effect in the LinuxThreads threading implementation. On that implementation, calling this
function causes the immediate termination of all threads in the application, except the calling thread. The cancellation state and cancel-
lation type of the to-be-terminated threads are ignored, and the cleanup handlers are not called in those threads.
This function is a nonstandard GNU extension; hence the suffix "_np" (nonportable) in the name.
pthread_kill_other_threads_np() is intended to be called just before a thread calls execve(2) or a similar function. This function is
designed to address a limitation in the obsolete LinuxThreads implementation whereby the other threads of an application are not automati-
cally terminated (as POSIX.1-2001 requires) during execve(2).
In the NPTL threading implementation, pthread_kill_other_threads_np() exists, but does nothing. (Nothing needs to be done, because the
implementation does the right thing during an execve(2).)
SEE ALSO execve(2), pthread_cancel(3), pthread_setcancelstate(3), pthread_setcanceltype(3), pthreads(7)COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2010-09-09 PTHREAD_KILL_OTHER_THREADS_NP(3)
I know very little about C and Unix. I have written a program to use threads. The program needs to get some values from a very large database.
I wrote a simple program and compiled but got the following errors.....
cc mythread.c -lthread
"/usr/include/pthread.h", line 120:... (3 Replies)
Discussion started by: reddyb
2. Post Here to Contact Site Administrators and Moderators
I'm relatively new-comer to these forums and have a Q to the mods. Just wondering what's the policy regarding the long running threads where they tend to go say over 30 posts and they become "troubleshooting" threads rather than being "educational" and/or "hinting" threads?
... (4 Replies)
I need to spawn mutilpe threads , each invoking a different set of shell scripts, in parallel.
What would be the best way to do that.
Any sample script would greatly help. I am a novice at Unix so any help is much appreciated.
Thanks (5 Replies)
I have a process which creates pthreads to generate some reports. After creating the reports these threads return null. But after 1024 threads, the process is not able to create any threads further.,and at max 5 threads are existing simultaneously and are returning the control back after... (2 Replies)
I tried to execute a sample pthread program to cancel a newly created one using pthread_cancel(). but using valgrind on my code shows some memory leak.
using namespace std;
void*... (4 Replies)
I am using RHEL5 and C lang for development.
I am getting some memory leak problem in pthread.
I hav developed a program which creates two threads for listening purpose on two diff ports. both the child threads are doing same job but on diff port no.
I am using... (4 Replies)
I have read many threads, but I still didn't find the right answer. May be i didn't find the right thread, though are so many threads for the same question.
Basically the situation is - find date in a file and replace it with another date. (its not homework, its part of lot of a big processing,... (10 Replies)
We have a T5140 server which has 128 threads in total. Is it possible to reduce the number of threads per core through some configuration changes? I am sorry for being so naive but I am one on this.
Why would I like to do this? Unfortunately we have this for an Oracle Database Server... (6 Replies)
I have found code like
exec 9<filename a number of times when looking over commonly used scripts here. What all does this do? Sometimes the filename is simply a list, but seems to always have read/write/execute attributes for all. I think the "<" means to accept this as input, but don't know... (3 Replies)