comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Scheduling behaviour issue
Date: Wed, 22 Apr 2020 12:34:48 +0100
Date: 2020-04-22T12:34:48+01:00	[thread overview]
Message-ID: <ly1rofhhyf.fsf@pushface.org> (raw)

As some will recall, I've based my Cortex GNAT RTS[1] (for ARM Cortex-M
devices, so far) on FreeRTOS[2].

I've now discovered an unfortunate difference between what the ARM
requires at D.2.3(9)[3] and the way FreeRTOS behaves. What we need is

    A task dispatching point occurs for the currently running task of a
    processor whenever there is a nonempty ready queue for that
    processor with a higher priority than the priority of the running
    task. The currently running task is said to be preempted and it is
    added at the head of the ready queue for its active priority.

but FreeRTOS adds the preempted task at the *tail* of its ready queue
([4], section Prioritized Pre-emptive Scheduling (without Time Slicing),
on page 95 or thereabouts).

I can see that this will make an application less predictable, but I
don't think it'll make a correct application misbehave.

I've been having some trouble thinking of a way to demonstrate the
(mis)behaviour!

[1] https://github.com/simonjwright/cortex-gnat-rts
[2] https://www.freertos.org
[3] http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-D-2-3.html#p9
[4] https://bit.ly/2VK7slM

             reply	other threads:[~2020-04-22 11:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22 11:34 Simon Wright [this message]
2020-04-22 16:16 ` Scheduling behaviour issue fabien.chouteau
2020-04-22 17:20   ` Simon Wright
2020-04-22 18:05     ` Anh Vo
2020-04-22 18:21       ` Niklas Holsti
2020-04-22 18:03 ` Niklas Holsti
2020-04-22 20:41   ` AdaMagica
2020-04-22 21:58     ` Niklas Holsti
2020-04-23  0:47       ` Jere
2020-04-23 10:56   ` Simon Wright
2020-04-23 12:38     ` Niklas Holsti
2020-04-23 12:57     ` Niklas Holsti
2020-04-23 11:48 ` Simon Wright
2020-04-23 13:18 ` Niklas Holsti
replies disabled

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