From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7d5642dc1158588b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Wed, 31 Jan 2007 03:59:07 -0600 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Ravenscar - program termination References: <87zm81txs1.fsf@ludovic-brenta.org> Date: Wed, 31 Jan 2007 10:59:03 +0100 Message-ID: <87bqkftt3s.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:bCUk3tmByV2rd/M7VKs8ybzepHo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 62.235.210.91 X-Trace: sv3-uKDRfkooVADhFfQvO++YT9gnU5Fq2ugwSWagmqZ5rp9nGWVuYISfHxONaM7Zv5uHyzJMowgl5FOikfD!Ogf0BClWqDovtrQI1pCjx1hrpZUkd7ehBgeFjhJ8p4i6uLaTxX+MlbRYWa/8XQKRuO2gRqEbCg== X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:8764 Date: 2007-01-31T10:59:03+01:00 List-Id: Maciej Sobczak writes: > I wrote a Hello World program and I want to impress my boss telling > him that my program complies with Ravenscar recommendations. That > sounds much more serious than a plain dumb Hello World program! A high-integrity "hello world"? With tasking? :) +pragma Profile (Ravenscar); with Ada.Text_IO; +with Ada.Synchronous_Task_Control; procedure Hello is + Blocker : Ada.Synchronous_Task_Control.Suspension_Object; begin Ada.Text_IO.Put_Line("Hello Ravenscar!"); loop - null; + Ada.Synchronous_Task_Control.Suspend_Until_True (Blocker); end loop; end Hello; That should solve your CPU utilisation problem :) > OK, back to serious mode. > One of the Ravenscar objectives is to allow implementations to provide > stripped-down runtime when the profile is requested. This is a nice > feature, even for programs that are not safety-critical in nature. > How does GNAT handle this? Can I expect it to build smaller (faster?) > executables when I say pragma Profile(Ravenscar) provided that the > program complies to all the restrictions anyway? I'm not sure how GNAT handles this, and I think it depends on the target. It makes no sense at all to write high-integrity software running on a low-integrity operating system (not to mention low-integrity hardware); the intention is that the high-integrity Ravenscar run-time kernel *is* the operating system. As a consequence, Ada.Text_IO in a high-integrity system makes little sense, unless you have a high-integrity console driver. Since the console driver would be hardware-dependent, you'd have to write your own to complement GNAT's minimal Ravenscar tasking kernel. I think that's why, in effect, high-integrity implies embedded. In low-integrity, non-embedded software, you cannot benefit from the "minimal kernel", "lock-free operation" or "configurable scheduling policies", but you can benefit from other inherent properties of the tasking model, which reduce the opportunities for deadlocks. PS. Keep in mind that calls to Ada.Text_IO.Put_Line are "potentially blocking", so you cannot call them from a protected object in Ravenscar. See ARM 9.5.1(8, 10), D.13.1(4/2), H.5(5/2). -- Ludovic Brenta.