Search code examples
synchronizationfreertos

Which RTOS synchronization method shall I use for waiting until all tasks are initialized?


I have a lot of tasks in my application. Some tasks depend on others.

For example I have console task that prints outputs from all other "worker" tasks, so all these tasks before printing anything must wait until console task is fully initialized.

I have also more dependencies like this, with kind of dependency tree structure. For example task_modbus needs 3 tasks to be initialized: task_uart, task_filesystem, task_console.

What kind of synchronization object shall I use?

At this moment I'm using semaphores, one for each task dependency relation.

I was thinking about EventGroup, but maybe there is something more lightweight?


Solution

  • The xEventGroupSync() API seems most appropriate.