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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3e11ef4efc073f6b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!postnews.google.com!r15g2000prh.googlegroups.com!not-for-mail From: belteshazzar Newsgroups: comp.lang.ada Subject: Re: requeue with abort and timed call Date: Sun, 4 Jan 2009 15:17:39 -0800 (PST) Organization: http://groups.google.com Message-ID: <86e1e26c-108e-4f8e-9dc8-0eeaadce84d3@r15g2000prh.googlegroups.com> References: <2a60b044-6a5c-4ce6-93e6-6eeefc8806c3@l33g2000pri.googlegroups.com> <1f6rcb1qwt7vx.1mckzyk9ucohf.dlg@40tude.net> <84c56781-1cb1-4d86-be14-e66fc9fdade6@w1g2000prk.googlegroups.com> <7p8onuvzdz18$.1m1dq8n3b52q5.dlg@40tude.net> <9j9ajg.3a7.ln@hunter.axlog.fr> <2a0a1de3-6736-4478-9378-50b8895fa20d@r15g2000prh.googlegroups.com> <133a14c1-efc1-4a27-bc66-cff24a75ef93@z28g2000prd.googlegroups.com> <4uQ7l.509148$yE1.49118@attbi_s21> NNTP-Posting-Host: 121.45.250.40 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1231111059 30119 127.0.0.1 (4 Jan 2009 23:17:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 4 Jan 2009 23:17:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r15g2000prh.googlegroups.com; posting-host=121.45.250.40; posting-account=SuaatgoAAADZMrKGiLdPOjCBBS4KZzVT User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3199 Date: 2009-01-04T15:17:39-08:00 List-Id: On Jan 4, 1:56=A0pm, "Dmitry A. Kazakov" wrote: > On Sun, 4 Jan 2009 10:03:44 -0800 (PST), ishik...@arielworks.com wrote: > > On Jan 4, 6:09=A0am, "Jeffrey R. Carter" > > wrote: > >> Delay statements and calls to Ada.Text_IO.Put_Line are potentially blo= cking > >> operations. It is an error to call potentially blocking operations fro= m a > >> protected action. See ARM 9.5.1. > > I'm sorry, I overlooked it. > > No, it is perfectly legal to use Put_Line in protected actions *with* GNA= T. > > GNAT implementation explicitly permits this use. So Jeffrey's comment was > irrelevant here. > > You should report this bug to AdaCore. > > > How about this one; > > > with Ada.Text_IO; use Ada.Text_IO; > > procedure Timed_Protected is > > =A0 =A0Z : boolean :=3D True; > > Pedantically, you should have added pragma Atomic (Z), because you access > it from different tasks. And probably Volatile (Z) to prevent loop > optimization. > > But much simpler would be a primitive busy waiting: > > entry E1 when True is > =A0 =A0T : Time :=3D Clock + 5.0; > begin > =A0 =A0for I in Unsigned_64'Range loop > =A0 =A0 =A0 exit when Clock >=3D T; > =A0 =A0end loop; > end E1; > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de it was my understanding that pragma atomic does nothing for tasks, it just tells the compiler to ensure that the architecture implements atomic memory access. also if pragma atomic is used this implies volatile.