[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[rtl] RTLinux concepts....
Hello Everyone,
I'd like to make certain that I've got a few concepts correct
when using the rtlinux functions. I'd be grateful if someone
could let me know if I've got things straight.
If I want to have a rt fuction called *once* but at a specific
delay later, I do a:
rt_task_init( &doOnceTask, doOnce, 1, 3000, 4 );
rt_task_make_periodic( &doOnceTask, rt_get_time() + delay, somePeriod );
Then in the function to be called only once, at time now+delay:
void once( int t ) {
// do something interesting....
// stop and further invocations
rt_task_suspend( &doOnceTask );
rt_task_wait();
}
Some questions...
Is this the best way to use the rt functions to have a function called
once, but at a precise time from now?
Is it ok to call rt_task_suspend from within the task that's being suspended?
Is the call to rt_task_wait not required? If I've already suspended the
task, should I just return?
Does returning from a task implicitly do a suspend on that task?
If I have one task that's updating a variable for other tasks to use, what
functions are available for mutual exclusion?
Thanks for any info!
Jim.
--- [rtl] ---
For more information on Real-Time Linux see:
http://www.rtlinux.org/