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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.31.152.208 with SMTP id a199mr28895777vke.4.1458688673977; Tue, 22 Mar 2016 16:17:53 -0700 (PDT) X-Received: by 10.182.125.37 with SMTP id mn5mr432905obb.10.1458688673937; Tue, 22 Mar 2016 16:17:53 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!y89no8733853qge.0!news-out.google.com!b22ni860qge.1!nntp.google.com!w104no8078886qge.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 22 Mar 2016 16:17:53 -0700 (PDT) In-Reply-To: <2c50ad2f-e6d5-4dc9-b4d1-905409311a97@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8201:bb5a:449e:1f9d:238b:482b; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8201:bb5a:449e:1f9d:238b:482b References: <2c50ad2f-e6d5-4dc9-b4d1-905409311a97@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <85fa0f28-081a-48e8-a4dc-e0e850daa100@googlegroups.com> Subject: Re: Assignment with Adjust and Task Safety From: rieachus@comcast.net Injection-Date: Tue, 22 Mar 2016 23:17:53 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:29850 Date: 2016-03-22T16:17:53-07:00 List-Id: On Tuesday, March 22, 2016 at 10:37:07 AM UTC-4, Jeremiah wrote: =20 > Note that I am not accounting for the temporary objects for brevity in th= e example. Additionally, this may just be bad design all around, but I am = trying to look at the mechanics behind this as well and if it is even possi= ble to do this safely. Very bad juju. It is reasonable to write (Ada) code that has an access val= ue declared constant, even if it is in a nested scope and changes value eve= ry time the scope enclosing the variable is called. Having multiple tasks = assigning to the same (global) variable is usually wrong, and as Randy poin= ted out, is very difficult to prove correct, even if it is... Having a rul= e that any variable set by more than one task will be protected saves you w= eeks of debugging.