How to program fine-grained real-time concurrent applications in C or Ada

Joel Sherrill joel at rtems.org
Thu Dec 31 19:52:18 UTC 2020


On Thu, Dec 31, 2020, 6:03 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> Hello Mattia,
>
> On 24/12/2020 11:24, Mattia Bottaro wrote:
> > I need to develop a multitasking real-time application with RTEMS
> > (preferably in Ada, but also C solutions are welcomed). I see that I
> > can use the Classic API
> > <https://docs.rtems.org/branches/master/c-user/index.html>, but they
> > are unsuitable to my purposes. As you can read here
> > <
> https://docs.rtems.org/branches/master/c-user/task/directives.html#task-wake-when-wake-up-when-specified>,
>
> > the rtems_task_wake_when directive is too coarse: "The timing
> > granularity of this directive is a second.".
> > I need to work with microseconds-granularity and I cannot find how to
> > do it.
>
> this limitation is do some implementation constraints which no longer
> apply. From an API point of view
>
> /**
>   * @ingroup RTEMSAPIClassicTypes
>   *
>   * @brief This type represents Classic API calendar times.
>   */
> typedef struct {
> [...]
>
>    /**
>     * @brief This member contains the clock tick of the second with
> values from 0
>     *   to rtems_clock_get_ticks_per_second() minus one.
>     */
>    uint32_t ticks;
> } rtems_time_of_day;
>
> it would be possible to also specify the clock driver ticks of a time
> point. The rtems_task_wake_when() uses _Thread_Timer_insert_realtime()
> which uses a time with a nanoseconds resolution. It would be easy to
> change the implementation of rtems_task_wake_when() to use the clock
> driver ticks.
>

This could be changed but I believe the original specifications called for
second boundary.

>
> As already mentioned, the clock_nanosleep() provides this functionality
> already.
>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20201231/4e0fd0b3/attachment.html>


More information about the users mailing list