Sujet : Re: Ichbiah 2022 compiler mode
De : niklas.holsti (at) *nospam* tidorum.invalid (Niklas Holsti)
Groupes : comp.lang.adaDate : 14. Sep 2024, 10:12:43
Autres entêtes
Organisation : Tidorum Ltd
Message-ID : <lkkurrFqpl7U1@mid.individual.net>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla Thunderbird
On 2024-09-14 9:13, Randy Brukardt wrote:
"Niklas Holsti" <niklas.holsti@tidorum.invalid> wrote in message
news:lkg1vvF1tp6U1@mid.individual.net...
...
Priorities are just optimization on how to manage cores when there are
not enough of them.
>
In some contexts it could be optimization -- for example, to increase
throughput in a soft real-time system -- but in hard real-time systems
priorities (or deadlines) are needed for correctness, not just for
optimizatiion.
This I don't buy: priorities never help for correctness. At least not
without extensive static analysis, but if you can do that, you almost
certainly can do the correctness without depending upon priorities.
You misunderstood me; perhaps I was too brief.
I said "hard real-time systems", which means that the program is correct only if it meets its deadlines, for which priorities or deadline-based scheduling are necessary if there are fewer cores than concurrent/parallel activities, and the application has a wide range of deadlines and activity execution times.
(To be honest, there is the alternative of using a single thread that is manually sliced into small bits, interleaving all the activities increment by increment, according to a static, cyclic schedule, but that is IMO a horribly cumbersome and unmaintainable design, though unfortunately still required in some contexts.)
I believe we agree that priorities should be used for other things, such as controlling access to shared data, only if there is a well-defined and safe mechanism for it, such as protected objects with priority ceilings and priority inheritance on a single core.