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.2 required=5.0 tests=BAYES_00,FROM_LOCAL_HEX, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4fe1e6b66c35dfe2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Vinzent Hoefler" <0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de> Newsgroups: comp.lang.ada Subject: Re: About task-safeness Date: Thu, 03 Feb 2011 18:59:42 +0100 Message-ID: References: <3195b61d-e545-454d-8516-4ba16b490df0@glegroupsg2000goo.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: individual.net okpBJGVkxVmalE+dOA/JOA5gZyKbF6nLm/wul87gmKbbOLquwQ Cancel-Lock: sha1:P/Eu4uga/wfzOwVda6mUuHLPH1U= User-Agent: Opera Mail/11.01 (Win32) Xref: g2news1.google.com comp.lang.ada:16850 Date: 2011-02-03T18:59:42+01:00 List-Id: Maciej Sobczak wrote: > On Feb 2, 10:14 pm, 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 specified, so long >> > |as all parameters that could be passed by reference denote nonoverlapping objects. >> >> > Apart from that, you probably have to trust the programmer - or some tool. >> >> 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 Of course not, because if you think a bit harder about it, the result is that both calls use a "parameter that could be passed by reference" denoting the same "non-overlapping object". Vinzent. -- You know, we're sitting on four million pounds of fuel, one nuclear weapon, and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn't it? -- Rockhound, "Armageddon"