comp.lang.ada
 help / color / mirror / Atom feed
From: rieachus@comcast.net
Subject: Re: Assignment with Adjust and Task Safety
Date: Tue, 22 Mar 2016 16:17:53 -0700 (PDT)
Date: 2016-03-22T16:17:53-07:00	[thread overview]
Message-ID: <85fa0f28-081a-48e8-a4dc-e0e850daa100@googlegroups.com> (raw)
In-Reply-To: <2c50ad2f-e6d5-4dc9-b4d1-905409311a97@googlegroups.com>

On Tuesday, March 22, 2016 at 10:37:07 AM UTC-4, Jeremiah wrote:
 
> Note that I am not accounting for the temporary objects for brevity in the 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 possible to do this safely.

Very bad juju.  It is reasonable to write (Ada) code that has an access value declared constant, even if it is in a nested scope and changes value every time the scope enclosing the variable is called.  Having multiple tasks assigning to the same (global) variable is usually wrong, and as Randy pointed out, is very difficult to prove correct, even if it is...  Having a rule that any variable set by more than one task will be protected saves you weeks of debugging.

      parent reply	other threads:[~2016-03-22 23:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 14:36 Assignment with Adjust and Task Safety Jeremiah
2016-03-22 17:40 ` Shark8
2016-03-22 18:50 ` Dmitry A. Kazakov
2016-03-22 19:14   ` Randy Brukardt
2016-03-26  1:31   ` Jeremiah
2016-03-26 21:27   ` J-P. Rosen
2016-03-22 23:17 ` rieachus [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox