From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ichbiah 2022 compiler mode Date: Sat, 14 Sep 2024 11:12:43 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 2L2QZA2bo1Dda3X9+PkfWQZ80cHyLIwsOqSufWWTWbGgojpsoU Cancel-Lock: sha1:lywXKk4gFjgjWnLZJatpoRgGcNk= sha256:NVDGK19UlUH3r4xSGj+he7CZ8OKywdpxyyT6GxAH+0s= User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:66378 List-Id: On 2024-09-14 9:13, Randy Brukardt wrote: > "Niklas Holsti" 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.