I want to set up a timer that repeatedly fires an event initialized with
SIGEV_UNBLOCK_INIT( event ) .
What would be an appropriate “go to sleep” call to use this to wake up?
I want to set up a timer that repeatedly fires an event initialized with
SIGEV_UNBLOCK_INIT( event ) .
What would be an appropriate “go to sleep” call to use this to wake up?
Bill Caroselli <qtps@earthlink.net> wrote:
I want to set up a timer that repeatedly fires an event initialized with
SIGEV_UNBLOCK_INIT( event ) .
It isn’t appropriate to use SIGEV_UNBLOCK_INIT with a timer, it is only
appropriate to use it with a kernel timeout, e.g. TimerTimeout().
What would be an appropriate “go to sleep” call to use this to wake up?
What are you trying to achieve?
Would this do it:
SIGEV_SIGNAL_THREAD_INIT( &event, SIGRTMIN, … )
pthread_sigmask(…) /* mask SIGRTMIN;
timer_create() /* for signal to this thread… /
sigwaitinfo() / for this signal only */
David Gibbs
dagibbs@qnx.com
David Gibbs <dagibbs@qnx.com> wrote:
DG > Bill Caroselli <qtps@earthlink.net> wrote:
I want to set up a timer that repeatedly fires an event initialized with
SIGEV_UNBLOCK_INIT( event ) .
DG > It isn’t appropriate to use SIGEV_UNBLOCK_INIT with a timer, it is only
DG > appropriate to use it with a kernel timeout, e.g. TimerTimeout().
What would be an appropriate “go to sleep” call to use this to wake up?
DG > What are you trying to achieve?
DG > Would this do it:
DG > SIGEV_SIGNAL_THREAD_INIT( &event, SIGRTMIN, … )
DG > pthread_sigmask(…) /* mask SIGRTMIN;
DG > timer_create() /* for signal to this thread… /
DG > sigwaitinfo() / for this signal only */
Thanks Dave. The SIGEV_UNBLOCK looked like the lightest weight mechanism
to use to wake up from a timer since I don’t need any other features to be
happening.
I will try what you suggest.
Steve: You might want to add a statement about when it is safe to use
SIGEV_UNBLOCK.
Bill Caroselli <qtps@earthlink.net> wrote:
Steve: You might want to add a statement about when it is safe to use
SIGEV_UNBLOCK.
I’ll pass this on to Kaushik. Thanks.