comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Ravenscar - release multiple tasks when an event occurs
Date: Tue, 05 May 2020 17:02:59 +0100
Date: 2020-05-05T17:02:59+01:00	[thread overview]
Message-ID: <lymu6mfjyk.fsf@pushface.org> (raw)
In-Reply-To: hh7pg5Fb9buU1@mid.individual.net

Niklas Holsti <niklas.holsti@tidorum.invalid> writes:

> On 2020-05-03 13:43, Simon Wright wrote:
>> I have several sensor tasks (in general, 2 at the moment) which will of
>> course be created and start execution during elaboration.
>
> Depends on the value specified for pragma
> Partition_Elaboration_Policy. If it is Sequential, the tasks start
> only after (most of) elaboration is completed -- RM H.6.

Indeed, I'd forgotten that.

The top level of the code has SPARK_Mode, and I'm fairly sure that
requires Sequential. I have Partition_Elaboration_Policy (Sequential),
anyway.

>> I'd like to ensure that they don't actually start reading and reporting
>> input data until the system is in a state to receive them.
>
> How/when does the system reach that state? At end of elaboration, or
> at some much later time? Should other tasks execute before that state
> is reached?

Some later time, and indeed other tasks do execute first.

>> With the Ravenscar profile it's not obvious how to do this (only one
>> entry per PO, only one task allowed to queue).
>
> You can of course create a special protected object for each sensor
> task that has an entry "wait until system in good state" and a
> procedure "declare system in good state" to open that entry.
>
> Or you could do the same with Suspension_Objects from
> Ada.Synchronous_Task_Control (but Gnat implements them as protected
> objects anyway, I think).

I think those suffer from the same problem.

  reply	other threads:[~2020-05-05 16:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 10:43 Ravenscar - release multiple tasks when an event occurs Simon Wright
2020-05-03 11:50 ` Niklas Holsti
2020-05-05 16:02   ` Simon Wright [this message]
2020-05-05 16:16     ` Niklas Holsti
2020-05-03 14:45 ` Jere
2020-05-05 16:05   ` Simon Wright
2020-05-03 15:09 ` J-P. Rosen
2020-05-05 16:11   ` Simon Wright
2020-05-05 17:02     ` Niklas Holsti
2020-05-03 15:13 ` Jeffrey R. Carter
2020-05-05 16:12   ` Simon Wright
2020-05-05 16:22 ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox