this is a question along the lines of “how long is a piece of string”… and I know that every application is completely different. But it is only for me to get some very rough feel about RTOS development being new to it.
On average and very roughly, how many tasks does an average application have? For example, applications like 3D printers or CNC milling machines, would tend to have 3 to 5 or maybe15 to 20 or even more?
Or if you have examples of other applications (maybe drones, DAQ systems or anything else) you know of or have done yourself… just some rough numbers to get a feel for it in different applications.
As you said, you absolutely cannot compare applications
But I bet many applications (including many of those I was working on) have less than 10 tasks.
Also the available amount of RAM might be a hard restriction since tasks have costs especially related to the required stack space per task. Many tasks might also lead to more inter-task communication/synchronization, which is a certain overhead.
However, it depends …
A Lot of my work is in access control. Typically, in terminals there is a fixed number of tasks for common, well, tasks such as badge lookup and event recording (make that something between 5 and 20, sometimes more) as well as a configuration-dependent count. For example, for each bus driving a serial peripheral interface, you have another one or 2, and each logical door may be represented as an fsm running in a separate task. Systems running at full config may easily accumulate 50.
It’s important to understand that the number of tasks running in a given system by itself is meaningless. If the job an embedded system needs to do can be expressed with a lot of concurrency and I/O bound computations, a lot of tasks are perfectly ok. If the tasks mostly run factually run as coroutines, continually waiting for each other and practically enforcing a linear control flow, it’s nothing but a bad design.
Thank you Hartmut and RAc