Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Sending signal from process A to a specific Process B's thread: Page 1 of 10 (10 Items)
   
Sending signal from process A to a specific Process B's thread  
Hello,

I'm currently writing a portable framework for RT-related programs, which should support RTAI, VxWorks, RTEMS and of 
course QNX Neutrino.

The problem that I'm currently trying to solve and that I'm having some difficulties to find a proper solution for QNX 
is this: Process A need to signal a specific thread of Process B. I know about sigaction/kill for processes, and I know 
of pthread_kill for signaling between threads of same the same process. I've tried under Linux to use pthread_kill 
between threads of different processes but all I got was a segfault on the 'killer' side.

I've however found a solution for Linux which is the following: process B saves in a shared memory are its PID and all 
its threads do the same for their respectiveTID (obtained using gettid() - which is NOT the same number as 
pthread_self() ).
Now process A can simply read the shared memory and signal a specific thread of process B using: tgkill(pid, tid, signo)
 which is a syscall that sends signal 'signo' to a thread 'tid' that must belong to process 'pid'.

Using the same procedure i.e. saving the pthread_self() results in the shared memory and then using 
pthread_kill(pthread_id) on process A side yielded a segfault.

Anyone has any tips or even a solution?

Thanks for all the help

Enrico