io-net and SIGEV_INTR

I’m creating a millisecond timer using SIGEV_INTR. I had no trouble doing
this in a small single-threaded demo program, but I can’t get the same code
to work within io-net. Is there any reason io-net can’t work with a
SIGEV_INTR timer? The following code runs in a worker thread spawned in my
above filter. InterruptWait() never returns.

SIGEV_INTR_INIT( &TimerEvent);
timer_create( CLOCK_REALTIME, &TimerEvent, &hTimer);
timer_settime( hTimer, 0, &ITime, NULL);
for(;:wink: {
InterruptWait( 0, NULL);
// do stuff
}

Thanks,
Shaun

This isn’t working as you expect it because there’s nothing to
associate this SIGEV_INTR with your thread. The usual method
is to use a SIGEV_PULSE which can be associated with a
connection, which in turn can be thread specific, or if many threads
are associated with the connection, they can switch off the
pulse code / value.

BTW you might see some unexpected results at 1ms since that’s
normally what what the ticksize is by default. You might
want to look a the thread titled “Tick-tock: Understanding the
Neutrino microkernel’s concept of time (Brian Stecher)” in
qdn.public.articles.

-seanb



Shaun Jackman <sjackman@nospam.vortek.com> wrote:

I’m creating a millisecond timer using SIGEV_INTR. I had no trouble doing
this in a small single-threaded demo program, but I can’t get the same code
to work within io-net. Is there any reason io-net can’t work with a
SIGEV_INTR timer? The following code runs in a worker thread spawned in my
above filter. InterruptWait() never returns.

SIGEV_INTR_INIT( &TimerEvent);
timer_create( CLOCK_REALTIME, &TimerEvent, &hTimer);
timer_settime( hTimer, 0, &ITime, NULL);
for(;:wink: {
InterruptWait( 0, NULL);
// do stuff
}

Thanks,
Shaun