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,4fe1e6b66c35dfe2 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z31g2000vbs.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: About task-safeness Date: Wed, 2 Feb 2011 14:16:09 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <3195b61d-e545-454d-8516-4ba16b490df0@glegroupsg2000goo.googlegroups.com> NNTP-Posting-Host: 85.2.36.147 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1296684969 16378 127.0.0.1 (2 Feb 2011 22:16:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 2 Feb 2011 22:16:09 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z31g2000vbs.googlegroups.com; posting-host=85.2.36.147; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:17798 Date: 2011-02-02T14:16:09-08:00 List-Id: On Feb 2, 10:14=A0pm, mockturtle wrote: > > Well, ARM 05, A(3/2) says: > > > |The implementation shall ensure that each language-defined subprogram = is reentrant in > > |the sense that concurrent calls on the same subprogram perform as spec= ified, so long > > |as all parameters that could be passed by reference denote nonoverlapp= ing objects. > > > Apart from that, you probably have to trust the programmer - or some to= ol. > > Thank you, that is what I needed. Note that this is actually quite weak guarantee. It says that any call that refers to the same object need not be task-safe, even if a common sense would suggest otherwise. It was already discussed here, but two notable examples that are worth to keep in mind are: - two tasks printing something on stdout are *not* safe - two tasks "only reading" values from the same container are *not* safe You need to provide your own protection in such cases. -- Maciej Sobczak * http://www.inspirel.com