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
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
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.
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?
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.