Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_kill(3t) [hpux man page]

pthread_kill(3T)														  pthread_kill(3T)

pthread_kill() - send a signal to a thread SYNOPSIS
thread Thread to which the signal is to be delivered. sig Signal to be delivered to thread. DESCRIPTION
The function is used to request that a signal be delivered to thread. The signal is asynchronously directed to thread in the calling process. The signal is handled in the context of the given thread; if the signal action results in the thread terminating or stopping, this action is applied to the whole process. If sig is zero, error checking is performed but a signal is not sent. RETURN VALUE
Upon successful completion, returns zero. Otherwise, an error number is returned to indicate the error (the variable is not set). ERRORS
If any of the following occur, the function returns the corresponding error number: [EINVAL] sig is an invalid or unsupported signal number. [ESRCH] No thread could be found corresponding to thread. AUTHOR
was derived from the IEEE POSIX P1003.1c standard. SEE ALSO
kill(2), sigaction(2), pthread_self(3T), raise(2). STANDARDS CONFORMANCE
Pthread Library pthread_kill(3T)

Check Out this Related Man Page

PTHREAD_KILL(3) 					     Linux Programmer's Manual						   PTHREAD_KILL(3)

pthread_kill - send a signal to a thread SYNOPSIS
#include <signal.h> int pthread_kill(pthread_t thread, int sig); Compile and link with -pthread. DESCRIPTION
The pthread_kill() function sends the signal sig to thread, another thread in the same process as the caller. The signal is asynchronously directed to thread. If sig is 0, then no signal is sent, but error checking is still performed; this can be used to check for the existence of a thread ID. RETURN VALUE
On success, pthread_kill() returns 0; on error, it returns an error number, and no signal is sent. ERRORS
ESRCH No thread with the ID thread could be found. EINVAL An invalid signal was specified. CONFORMING TO
Signal dispositions are process-wide: if a signal handler is installed, the handler will be invoked in the thread thread, but if the dispo- sition of the signal is "stop", "continue", or "terminate", this action will affect the whole process. SEE ALSO
kill(2) sigaction(2), sigpending(2), pthread_self(3), pthread_sigmask(3), raise(3), pthreads(7), signal(7) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at Linux 2009-01-28 PTHREAD_KILL(3)

14 More Discussions You Might Find Interesting

1. Shell Programming and Scripting


Hi,all! Now ,I write perl for windows platform,and will use signal for asynchronous operations ,but I find it could bring some bugs if it is used incorrectly ,pls help!!! :D (1 Reply)
Discussion started by: hhh101
1 Replies

2. Programming

[Problem] raise a signal in FreeBSD

I am trying to send a SIGUSR1 to a set of process. Please tell me how to do. I've tried the system call raise(int sig) but it just raise a signal of to the 'current process.' My program is about a network chat server. When a client connects in, The main process will fork a new process... (1 Reply)
Discussion started by: Namely
1 Replies

3. UNIX for Dummies Questions & Answers

Alarm signal

Hi, when I execute a script on unix AIX, I've got an error message: "Execution: 85328 Signal d'alarme". If I edit this file with "vi", I ve got the same error after a while (about 1 minute). If I try with another user I still have the problem. But if I rename this file, no problem. My... (5 Replies)
Discussion started by: cgsteph
5 Replies

4. Programming

Signal Names

Hi everyone, Is there a variable or built in function in the Unix env. for me to obtain the name of a signal that is caught? As far as I understand only a numeric value of the signal is returned to the handler. For example: void handler (int signum) { ... (2 Replies)
Discussion started by: laila63
2 Replies

5. Programming

How to cancel a thread safely from the initial thread?

how about asynchronous canceling? or with signal? if with signal whether it effects the process? my english so badly :( :( (1 Reply)
Discussion started by: alan.zhao
1 Replies

6. Programming

sychronize process using pipe?

can pipe sychronize thread or process? because I'm trying to create 5 thread or process that can take an integer value and display it. each time a thread display the value, it has to be decrement it by 1 until the value has reach 0. The problem that I'm having is how can that integer value be... (1 Reply)
Discussion started by: saipkjai
1 Replies

7. Programming

Good Unix Online Study Material

HI Friends, I wanted to start this thread inorder to keep all the Unix starters to easily find useful material through this thread...I request you all to provide with the URL address of any gud material you know... thanks and regards... (2 Replies)
Discussion started by: rahul3894singh
2 Replies

8. Post Here to Contact Site Administrators and Moderators

Thread questions

I created a thread a couple of days ago and received some help - now I have some questions about general forum use. 1) I see that somehow the thread was rated and there are some stars by it. What does this mean and who rated it? 2) Should I resolve the thread when I am finished with it? 3) Does... (1 Reply)
Discussion started by: gsander
1 Replies

9. Shell Programming and Scripting

How to send SIGNAL to the thread?

Hello, I have to send SIGSEGV to the thread. What is the simplest and efficient way to do that? (6 Replies)
Discussion started by: Rahulpict
6 Replies

10. UNIX for Dummies Questions & Answers

process and thread

i want to know a difference between process and thread,give a program to tell the difference (2 Replies)
Discussion started by: annapurna konga
2 Replies

11. UNIX for Advanced & Expert Users

Implementing thread in UNIX

Hi For our load testing , we are using stubs (unix shell script) which send the response to the request coming from the application. As the unix stub is single threaded , it is responding to only one request whereas multiple requests come in parallely. I haven't worked on thread concepts... (5 Replies)
Discussion started by: jenanee
5 Replies

12. Shell Programming and Scripting

Problem in quitting/exiting from sqlplus

Hello, This is my first post and I would be very thankful if you can help me. I've already searched in the forum and I've found a very similar thread in wich my problem is solved, but the thread is closed and the solution given in it doesn't work in my shell: 153194-problem-quitting-sqlplus ... (11 Replies)
Discussion started by: JuanPerez
11 Replies

13. UNIX for Advanced & Expert Users

How to kill a thread among several threads belongs to a process?

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

14. Post Here to Contact Site Administrators and Moderators

Request: Move thread to a different subforum

Hi, I've just posted a new thread on the "IP Networking" subforum, with the subject "Check connectivity with multiple hosts - BASH script available here". However, I think it should be on the "Shell Programming and Scripting" subforum, could you please move that thread there? Thanks! (1 Reply)
Discussion started by: Fr3dY
1 Replies

Featured Tech Videos