Barr Group TwitterBarr Group Vimeo


The following C coding rules relate to the representation of tasks (a.k.a., threads):

Rule 6.4.a.) All functions that represent tasks (a.k.a., threads) shall be given names ending with _task().


alarm_task (void * p_data)
    alarm_t  alarm = ALARM_NONE;
    uint8_t   err  = OS_NO_ERR;

    for (;;)
        alarm = OSMboxPend(alarm_mbox, &err);
        // Process alarm here.


Each task in a real-time operating system (RTOS) is like a mini-main(), typically running forever in an infinite loop. It is valuable to easily identify these important functions during code reviews and debugging sessions.


Alternatively, _thread() may be used to end the function name.


This naming convention shall be enforced during the detailed design phase and in code reviews.

What’s happening and how it’s done. Get in the know.

Sign Up for Our Newsletter

Receive free how-to articles, industry news, and the latest info on Barr Group webinars and training courses via email. 

To prevent automated spam submissions leave this field empty.