|
01/03/2012 8:40 AM
post90789
|
I don't see why it would be 8-10 seconds but I don't work for QSSL so can't answer further on that. If the problem's on
your end my guess is you have a higher priority thread that runs READY every now and then for 8-10 seconds or an
interrupt handler that you don't return from for 8-10 seconds or a misbehaving interrupt handler that's attached to the
timer interrupt.
However, the Library Reference docs for sigevent under SIGEV_THREAD say "We don't recommend using this type of event.
Pulses are more efficient." Creating a thread is a bit heavy handed, especially for a repeating timer. I know your timer
is 1 second but I don't know what your allowable error is.
So I'd suggest just changing your code to have an always running thread with an infinite loop that`s blocked waiting for
a pulse and use SIGEV_PULSE instead or if portability is an issue then have the running thread blocked on sigwaitinfo()
and use SIGEV_SIGNAL instead.
-Steven D.
|
|
|
|
|
|
01/03/2012 9:05 AM
post90793
|
Hi Christian,
Is your system time sometimes adjusted automatically? Try using CLOCK_MONOTONIC as the clock type.
Cheers,
Thomas
----- Originalnachricht -----
Von: Christian Scheuch [mailto:community-noreply@qnx.com]
Gesendet: Tuesday, January 03, 2012 05:32 AM
An: ostech-core_os <post90787@community.qnx.com>
Betreff: Timer expiry
We are creating timer through timer_create API using
clock_id as CLOCK_REALTIME,
event type as SIGEV_THREAD,
and have registered some function for notification
We start this periodic timer with timeout value of 1 sec.
We have observed that most of times our function registered for notification is called after 1 sec. But sometimes our
function registered for notification is not called for several seconds (like 8-10 seconds).
What could be the reasons for this ?
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post90787
|
|
|
|
|