comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: How D.15 "Timing Events" are implemented? (SIGALRM)
Date: Thu, 16 Nov 2017 16:22:55 +0000
Date: 2017-11-16T16:22:55+00:00	[thread overview]
Message-ID: <lyk1yqdwgw.fsf@pushface.org> (raw)
In-Reply-To: ouiug6$ldd$1@gioia.aioe.org

Victor Porton <porton@narod.ru> writes:

> Signal handlers (including SIGALRM) on Unix must not call non-reentrant 
> functions.
>
> So how D.15 Timing Events works in Ada? (I am interested mostly in GNAT 
> implementation.)

You can look at the implementation just as well as I can.

The plain GCC source runs a highest-priority task, which as implemented
loops over the queued events every 100 ms.

My Cortex GNAT RTS version[1] does the same but every 10 ms (plus a
what was meant to be a slight optimisation if there is a next event, but
which I see now I look at it is wrong if the next event is more than 10
ms away).

AdaCore's bare-board implementations run timing events off timer
interrupts (note, *not* SIGALRMs).

[1] https://github.com/simonjwright/cortex-gnat-rts/blob/master/common/a-rttiev.adb

> Because Ada RM does not require the handler to be "reentrant", this
> cannot be implemented straight as a SIGALRM handler. What is the
> implementation?

If this were relevant, I'd say that the ARM may not require the handler
to be reentrant, but people who buy (or use!) Ada compilers expect them
to work, so the implementers have to deal with "problems" like this all
the time.

      reply	other threads:[~2017-11-16 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16  2:51 How D.15 "Timing Events" are implemented? (SIGALRM) Victor Porton
2017-11-16 16:22 ` Simon Wright [this message]
replies disabled

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