"Dmitry A. Kazakov" <mailbox@[EMAIL PROTECTED]
> writes:
> On Fri, 18 Jul 2008 08:31:29 -0700 (PDT), Anh Vo wrote:
>
>> On Jul 17, 12:31 pm, Simon Wright <simon.j.wri...@[EMAIL PROTECTED]
> wrote:
>
>>> But there are limits on what is permissible within a protected
>>> procedure, are there not?
>
> [...]
>
>> My design is completely different from yours. Indeed, an explicit
>> task is not needed. See Gem #15, Timers, for details.
>> http://www.adacore.com/2007/10/29/ada-gem-15/
>
> Hmm, but it is exactly the design presented by Simon. The problem with
> it is that the action fired upon a timer event is called from a
> protected procedure.
>
> This is IMO not what Maciej wanted, because as Simon has pointed out
> protected procedures are very limited in what they allowed do and in
> how they do it.
And further, they are called at interrupt priority (I haven't read up
enough to understand D-15 14/2, but see 25/2: 'executed directly by the
real-time clock interrupt mechanism'), so there are going to be
interesting issues related to shared variable access.
If you aren't running on an RTOS, why are you bothering with the added
complexity? and if you are, won't the standard Ada mechanisms (delay
until, etc) do the trick? (they do for us with VxWorks). I don't quite
buy the notion that RTOS => use timers (at least, not without sup****ting
them as a variation on the general notion of event, so that some events
can be scheduled to happen in the furure). Some thoughts on this here --
http://coldframe.sourceforge.net/coldframe/event-modelling.html


|