Generating Signals

Hello im a Neutrino 2 user with a signal question.

First an example : When you hit ’ control C ’ on the keyboard a SIGINT
signal is generated.

But : How would I go about writing my own code to generate a SIGUSR1
signal, when I hit
a certain key combo, mmm lets say ’ control H ’ or ’ control * '?

Im trying to do this to eliminate a thread that waits (polls) for user
input.
Thank you very much

Damien

What about an additional thread that just waits for keyboard input? Once it
got the desired key combo, it terminates the thread that polls and itself?

“Demian” <damient@wave.home.com> wrote in message
news:Bl1e6.37927$V22.8358777@news4.rdc1.on.home.com

Hello im a Neutrino 2 user with a signal question.

First an example : When you hit ’ control C ’ on the keyboard a SIGINT
signal is generated.

But : How would I go about writing my own code to generate a SIGUSR1
signal, when I hit
a certain key combo, mmm lets say ’ control H ’ or ’ control * '?

Im trying to do this to eliminate a thread that waits (polls) for user
input.
Thank you very much

Damien

“Markus Loffler” <loffler@ces.clemson.edu> wrote in message
news:95bsl2$8j$1@inn.qnx.com

What about an additional thread that just waits for keyboard input? Once
it
got the desired key combo, it terminates the thread that polls and itself?

“Demian” <> damient@wave.home.com> > wrote in message
news:Bl1e6.37927$> V22.8358777@news4.rdc1.on.home.com> …
Hello im a Neutrino 2 user with a signal question.

First an example : When you hit ’ control C ’ on the keyboard a SIGINT
signal is generated.

But : How would I go about writing my own code to generate a SIGUSR1
signal, when I hit
a certain key combo, mmm lets say ’ control H ’ or ’ control * '?

Im trying to do this to eliminate a thread that waits (polls) for user
input.

Look at io_notify to get notification of keyboard event, thus you won’t
have to poll.

Thank you very much

Damien

\

Demian <damient@wave.home.com> wrote:

Hello im a Neutrino 2 user with a signal question.

First an example : When you hit ’ control C ’ on the keyboard a SIGINT
signal is generated.

But : How would I go about writing my own code to generate a SIGUSR1
signal, when I hit
a certain key combo, mmm lets say ’ control H ’ or ’ control * '?

Im trying to do this to eliminate a thread that waits (polls) for user
input.
Thank you very much

Why not use something like ionotify() to ask for notification when there
is input?

-David

QNX Training Services
dagibbs@qnx.com

David Gibbs wrote:

Demian <> damient@wave.home.com> > wrote:
Hello im a Neutrino 2 user with a signal question.

First an example : When you hit ’ control C ’ on the keyboard a SIGINT
signal is generated.

But : How would I go about writing my own code to generate a SIGUSR1
signal, when I hit
a certain key combo, mmm lets say ’ control H ’ or ’ control * '?

Im trying to do this to eliminate a thread that waits (polls) for user
input.
Thank you very much

Why not use something like ionotify() to ask for notification when there
is input?

It will raise signal for any input. And when it does raise signal you
don’t know how much input is there and have to drain it all if you want
it to be raised reliably next time. Might work, but not very convinient.

If you do it in the thread and use pulse, then you do it syncronously
and your hot key will not be processed until your thread is ready to
receive pulse. Might work too, but you need dedicated thread to handle
input anyway.

  • igor