Skip to contentSkip to conversation

pthread_make_periodic_np initial start date

Xenomai-help Steve Deiters 2 participants 2 messages Feb 2, 2010

lore
Share & tools
lore
#0 lore raw

Is there a way to specify no initial delay when calling pthread_make_periodic_np? If I pass a value directly obtained from clock_gettime, it will return a ETIMEDOUT error due to time passing before I make the call. I could add a small delay to the value obtained from clock_gettime, but I would be concerned that due to other happenings in the system, the absolute date may still have passed by the time it gets around to calling pthread_make_periodic_np.

What I would be looking for I guess is what happens when I call rt_task_set_periodic with an idate parameter of TM_NOW. Is there any way to simulate this behavior?

Thanks.

#1 lore raw
Quoted 11 lines · Steve Deiters

Is there a way to specify no initial delay when calling pthread_make_periodic_np? If I pass a value directly obtained from clock_gettime, it will return a ETIMEDOUT error due to time passing before I make the call. I could add a small delay to the value obtained from clock_gettime, but I would be concerned that due to other happenings in the system, the absolute date may still have passed by the time it gets around to calling pthread_make_periodic_np.

What I would be looking for I guess is what happens when I call rt_task_set_periodic with an idate parameter of TM_NOW. Is there any way to simulate this behavior?

pthread_make_periodic_np is a legacy from RTLinux. You should be using clock_nanosleep instead.

That said, pthread_make_periodic_np internally uses the same service as rt_task_set_periodic, and TM_NOW is just 0. So, you can probably pass a timespec with tv_sec and tv_nsec both 0.

Signature · 1 line
					    Gilles.