synchronizing two rate monotonic timers between threads

Ebenezer ebbys89 at gmail.com
Wed Oct 2 14:43:21 UTC 2019


I am working with RTEMS 5 - SMP enabled. I have 2 questions.

1) I am trying to synchronize the rate monotonic timer(id2) of a
thread with the rate monotonic timer(id1) of another thread. To do
that I have the following lines in one of the threads.

rtems_rate_monotonic_get_status(id1, remaining_time)
rtems_rate_monotonic_period(id2, deadline - remaining_time)

Inorder for this to work correctly, the thread should not be
pre-empted between the two function calls. When I tried to use
rtems_interrupt_local_disable(), it creates a runtime error
INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT. Is there another way
to temporarily disable thread pre-emption until the two functions
completes execution?

2) What would be the best way to implement a thread in RTEMS that has
a Deadline != Period. One way to do it is by using multiple rate
monotonic timers inside each thread. But what would be a better
implementation when the outermost timer(period) is common for all the
threads?

Thanks
Ebenezer


More information about the users mailing list