Skip to contentSkip to conversation

Multithreading and signals on linux

DISCUSSION Robert Hancock 1 participant 1 message Aug 30, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 8 lines · Shrikrishna Khare

Hi,

Am using pthread_kill to send SIGUSR1 from thread t1 to thread t2.
However, I am unable to have "different" signal handlers for threads t1 and t2 for same signal SIGUSR1.
I have ensured that I set the signal handler for t1 and t2
separately in different functions. Could anyone please tell me if I am missing on something?

The signal will be handled in the thread specified, however signal handlers are global to the process. You cannot have different signal handlers for different threads in the same process. This is the way POSIX pthreads are specified to work.

Signature · 3 lines
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/