[PATCH 7/7] rtems: Add rtems_task_build()

Chris Johns chrisj at rtems.org
Mon Aug 31 00:34:34 UTC 2020


On 31/8/20 12:49 am, Sebastian Huber wrote:
> On 22/08/2020 09:49, Chris Johns wrote:
> 
>> On 21/8/20 9:51 pm, Sebastian Huber wrote:
>>> In contrast to rtems_task_create() this function creates a task with a
>>> user-provided task storage area.
>> The name is build but it creates a task? I am wondering about
>> rtems_task_create_static or something along this line?
> 
> A function to do a static initialization is a contradiction from my point of
> view. Static initialization means for me that you statically initialize a data
> structure and then it is ready to use (it may involve a static constructor).
> 
> The function builds a task from user-provided (stack, attributes, etc.) and
> system-provided (thread control block) components.

Build and create are both verbs which means both contradict the idea of
something being static. By tradition we assume a function's naming is in the
run-time context and we do not consider the fact a compiler may optimise the
operation and prepare the result before the code runs.

I am concerned there maybe doubt about how the calls are to be used if you are
not familiar with the API and it's history. Do I need to create a task then
build it before I start it? The call names I proposed both create a task, one is
static and by default the other is not.

Chris


More information about the devel mailing list