Der Herr Hofrat wrote:
> 
> > What do I need if I don't want a periodic thread?
> > That is, I want to set a dead-line for my thread without using periodic
> > thread?
> >
> 
>   next_time=calc_time(); /* calculate the next time you want to run in NS */
>   now=clock_gethrtime(); /* get the current time */
> 
>   while(1){
>     clock_nanosleep(CLOCK_REATLTIME,TIMER_ABSTIME,hrt2ts(now+next_time),NULL);
> 
>     < your rt code >
> 
>     next_time=calc_time();
>     now=clock_gethrtime();
>   }
I don't understand...
I read the man page for clock_nanosleep(). It says it suspends execution
of a thread.
If I set a dead line after 2s I would like it had finished at least in
2s.
Your code seems to wait 2s and then it executes rt code...

thanks
-- 
Massimiliano Cialdi
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to