SIGEV_SIGNAL_THREAD

Hi,

in qnx docs it explains:

SIGEV_SIGNAL_THREAD
Send a signal to a specific thread. The following fields are used:
int sigev_signo
The signal to raise. This must be in the range from 1 through NSIG - 1.
short sigev_code
A code to be interpreted by the signal handler. This must be in the range
from SI_MINAVAIL through SI_MAXAVAIL.
void *sigev_value.sival_ptr
A 32-bit value to be interpreted by the signal handler.
</qnx docs>

may be i am misundesrtanding this:
but i think so:
SIGEV_SIGNAL_THREAD allows to send signal sigev_signo
where to? what is threadid?

AFAIK, signal handler should be set by that thread
if so – how can i send signal to PARTICULAR thread?
and what is “sigev_code” ? AFAIK, signal handler has single argument –
“signo”
and what is “*sigev_value.sival_ptr” ? (the same above)

explain me, plz
and correct me if i misundesrtanding


Thanks
vasilii

“vasilii” <vv40in@rambler.ru> wrote in news:ae2chh$4qt$1@inn.qnx.com:

AFAIK, signal handler should be set by that thread

Signal handlers are process wide.

if so – how can i send signal to PARTICULAR thread?

Depending on the signal, you can and cannot.

If you have a asyncronous signal, you can target the process, and have
every thread mask that signal out (except the thread you wish to target).
If you have a syncronous signal hit - it will target the thread of
execution causing said signal. If that thread maskes that signal - it will
remain pending until an unmask occurs.

Mixing threads and signals is a nasty can of worms that should be avoided
if at all possible. A good reference on signals and threads is the
“Programming with POSIX threads” book from publisher AW.


\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Thanks,

but also, my question was about SIGEV_SIGNAL_THREAD.
could You plz, explain me that


Thanks
vasilii

Adam Mallory <amallory@qnx.com> ÐÉÛÅÔ ×
ÓÏÏÂÝÅÎÉÉ:Xns92297E5C448Famalloryqnxcom@209.226.137.4…

“vasilii” <> vv40in@rambler.ru> > wrote in news:ae2chh$4qt$> 1@inn.qnx.com> :

AFAIK, signal handler should be set by that thread

Signal handlers are process wide.

if so – how can i send signal to PARTICULAR thread?

Depending on the signal, you can and cannot.

If you have a asyncronous signal, you can target the process, and have
every thread mask that signal out (except the thread you wish to target).
If you have a syncronous signal hit - it will target the thread of
execution causing said signal. If that thread maskes that signal - it
will
remain pending until an unmask occurs.

Mixing threads and signals is a nasty can of worms that should be avoided
if at all possible. A good reference on signals and threads is the
“Programming with POSIX threads” book from publisher AW.


\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net