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=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ravenscar and context switching for Cortex-M4 Date: Fri, 13 Feb 2015 19:01:54 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="4eba6dd55c03f4a8d448cad2a88d67ef"; logging-data="1154"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19r7ovIkSUJ9tFARuZ+TeyadmNl68AGtOY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:HHl1JhV9RfHcIHhw7lt6t5xwQso= sha1:MXkWC2aeV3dUJEVDM4oi2RfLNOM= Xref: number.nntp.giganews.com comp.lang.ada:192269 Date: 2015-02-13T19:01:54+00:00 List-Id: Niklas Holsti writes: > AIUI, the Ravenscar rules mean that in a PO with an entry, the entry > is basically implemented by: > - a Boolean flag, the barrier for the entry > - one pointer to the (at most one) task waiting on the closed entry. > > It would IMO not be a great complication to allow more than one entry > per PO; it seems to enough to duplicate the above implementation > components for each entry. Still needs no queues of tasks, as long as > Max_Entry_Queue_Length => 1. I think that would be OK in principle, but GNAT uses - for example - the type System.Tasking.Protected_Object.Single_Entry.Protection_Entry, so might get a little confused if asked to support more than one! As for the barrier, which has to be a plain Boolean in Ravenscar (not even "not Closed"), that's implemented using System.Tasking.Protected_Objects.Entry_Body, which is a record containing two accesses-to-subprogram; 'Barrier' designates a function returning Boolean, and 'Action' implements the body of the entry. So I think one could have more complex conditions at negligible cost. GNAT has Profile (Restricted), see s-rident.ads; the restrictions added to Restricted to make Ravenscar are (at 4.9.1, haven't checked whether this has changed in 5) No_Calendar No_Implicit_Heap_Allocations No_Local_Timing_Events No_Relative_Delay No_Select_Statements No_Specific_Termination_Handlers No_Task_Termination Simple_Barriers