sys/siginfo.h error

There is an error in the file sys/siginfo.h :

In the definition of macro SIGEV_THREAD_INIT :


#define SIGEV_THREAD_INIT(__e, __f, __v, __a) (
(__e)->sigev_notify = SIGEV_INTR, <----------- SIGEV_THREAD
(__e)->sigev_notify_function = (__f),
(__e)->sigev_value.sival_ptr = (void *)(__v),
(__e)->sigev_notify_attributes = (__a))

Bruno <bruno.suarez@scola.ac-paris.fr> wrote:

There is an error in the file sys/siginfo.h :

#define SIGEV_THREAD_INIT(__e, __f, __v, __a) (
(__e)->sigev_notify = SIGEV_INTR, <----------- SIGEV_THREAD

All part of our cunning plan to get people not to use that event type :slight_smile:.

Thanks, it’s fixed here and may just squeak into the next patch.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

Hello,

I have just added this issue to the Knowlege Base at http://qnd.qnx.com.
You can find the solution to this issue, by searching on “siginfo.h”.
You’ll also find the answer at the following link:

http://support.qnx.com/support/bok/solution.qnx?10146

Best Regards,

Marcin


Brian Stecher <bstecher@qnx.com> wrote:

Bruno <> bruno.suarez@scola.ac-paris.fr> > wrote:
There is an error in the file sys/siginfo.h :

#define SIGEV_THREAD_INIT(__e, __f, __v, __a) (
(__e)->sigev_notify = SIGEV_INTR, <----------- SIGEV_THREAD

All part of our cunning plan to get people not to use that event type > :slight_smile:> .

Thanks, it’s fixed here and may just squeak into the next patch.


Brian Stecher (> bstecher@qnx.com> ) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

Marcin Dzieciol
Technical Support
QNX Software Systems Ltd.
Email: <marcind@qnx.com>

Marcin Dzieciol wrote:

Hello,

I have just added this issue to the Knowlege Base at > http://qnd.qnx.com> .
You can find the solution to this issue, by searching on “siginfo.h”.
You’ll also find the answer at the following link:

http://support.qnx.com/support/bok/solution.qnx?10146

Best Regards,

Marcin

Brian Stecher <> bstecher@qnx.com> > wrote:
Bruno <> bruno.suarez@scola.ac-paris.fr> > wrote:
There is an error in the file sys/siginfo.h :

#define SIGEV_THREAD_INIT(__e, __f, __v, __a) (
(__e)->sigev_notify = SIGEV_INTR, <----------- SIGEV_THREAD

All part of our cunning plan to get people not to use that event type > :slight_smile:> .

why don’t use this event type ?

Bruno <bruno.suarez@scola.ac-paris.fr> wrote:

Marcin Dzieciol wrote:
Brian Stecher <> bstecher@qnx.com> > wrote:
Bruno <> bruno.suarez@scola.ac-paris.fr> > wrote:
There is an error in the file sys/siginfo.h :

#define SIGEV_THREAD_INIT(__e, __f, __v, __a) (
(__e)->sigev_notify = SIGEV_INTR, <----------- SIGEV_THREAD

All part of our cunning plan to get people not to use that event type > :slight_smile:> .

why don’t use this event type ?

Creating a thread is a relatively heavyweight operation. Doing it in
response to a sigevent (which typically wants fast response) is generally
a bad idea - there is almost always a better way of writing the code.
E.g. Create a channel and use the dispatch_* functions to have a pool
of threads that block on it waiting for a SIGEV_PULSE event. If you’re
a resource manager (as all true thinking Neutrino programs should be :slight_smile:,
you already have the pool of threads sitting around.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

Bruno <bruno.suarez@scola.ac-paris.fr> wrote:

Brian Stecher <> bstecher@qnx.com> > wrote:
Bruno <> bruno.suarez@scola.ac-paris.fr> > wrote:
There is an error in the file sys/siginfo.h :

#define SIGEV_THREAD_INIT(__e, __f, __v, __a) (
(__e)->sigev_notify = SIGEV_INTR, <----------- SIGEV_THREAD

All part of our cunning plan to get people not to use that event type > :slight_smile:> .



why don’t use this event type ?

Well, the latency is really bad – it has to create a new thread to
handle the event.

And, the side-effect of making a mistake with the frequency of generating
the event is… unfortunate… kind of like shooting yourself in the foot
with a machine gun. Can you imagine attaching this event to a moderately
high frequency interrupt? Hm… a new thread every millisecond. Fun.

-David