comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Interresting difference in Normal-Returns/Expression-Functions and Extended-Returns.
Date: Thu, 25 Apr 2013 08:19:52 -0700 (PDT)
Date: 2013-04-25T08:19:52-07:00	[thread overview]
Message-ID: <311a34d1-5527-4abc-9677-be3b2c8d3739@googlegroups.com> (raw)
In-Reply-To: <c5f03831-5aec-4045-835a-d1fad2ccec5e@googlegroups.com>

On Thursday, April 25, 2013 1:48:47 AM UTC-7, egilhh wrote:

> > I don't see a language reason for that.  The tasks are all created with allocators, and the type of the allocator alone should determine what master the tasks depend on--not a block declaring an array that contains the access objects.  If it's true that the block doesn't exit until all the tasks created by allocators have completed, then it's probably a GNAT bug.  I'd need to study it more carefully to make sure, though.  There may be some relevant language rules I'm missing, or something else I'm missing.

> I've been reading up on the accessibility rules (RM 3.10.2), and the rules
> for functions returning anonymous access types have changed from 2005 to 2012.
> In my understanding, 2012 now requires the block to wait:
> 
> RM 3.10.2(10.1/3): "The accessibility level of the result of a function call is
> that of the master of the function call, which is determined by the point of
> call as follows:"
> 
> RM 3.10.2(10.2/3): "If the result is used (in its entirety) to directly
> initialize part of an object, the master is that of the object being
> initialized. In the case where the initialized object is a coextension (see
> below) that becomes a coextension of another object, the master is that of the
> eventual object to which the coextension will be transferred."
> 
> RM 3.10.2(10.7/3): "In the case of a call to a function whose result type
> is an anonymous access type, the accessibility level of the type of the result
> of the function call is also determined by the point of call as described
> above"),
> 
> whereas 2005 permitted the other behavior. (A language lawyer is needed to
> confirm this)

Offhand, I don't think these new rules are relevant to this particular question.  They define the "master of a function call".  However, the master on which a task created by an allocator depends is the "master that includes the elaboration of the declaration of the ultimate ancestor of the given access type" (9.3(2)), which I think is different.  Basically, I think that if the new rules in 3.10.2 were supposed to impact how a master is computed for an allocator that returns anonymous-access-to-task, something would have to be changed in 9.3(2) as well.  Also, I think that the new changes were supposed to change how accessibility levels are determined (for the purposes of doing accessibility checks and preventing dangling references), not to change what tasks depend on.  But I could be wrong, and it's certainly possible that this was a combination of features that escaped the notice of the language designers when this change was made.

Thanks for finding the new rules; I wasn't really aware of them (I was aware that there were some changes but I didn't know much about what they were).  I really am not sure my analysis is correct.  Probably, a language lawyer who was involved in AI05-234 needs to weigh in.  I'll probably try to read that AI also to see if accesses-to-tasks and/or task dependence were discussed at all, and what was said about them.  The whole thing is pretty confusing.

                            -- Adam



  reply	other threads:[~2013-04-25 15:19 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 18:27 Interresting difference in Normal-Returns/Expression-Functions and Extended-Returns Shark8
2013-04-22 19:13 ` Dmitry A. Kazakov
2013-04-22 20:11   ` Shark8
2013-04-23  6:15     ` Simon Wright
2013-04-23  7:35     ` Stephen Leake
2013-04-23  8:58     ` Dmitry A. Kazakov
2013-05-02  2:20     ` Randy Brukardt
2013-05-02  4:41       ` Shark8
2013-04-23  6:32 ` egilhh
2013-04-23 15:24   ` Adam Beneschan
2013-04-24  5:56     ` egilhh
2013-04-24 14:40       ` Adam Beneschan
2013-04-25  5:30         ` egilhh
2013-04-25  5:41           ` Shark8
2013-04-23 16:00 ` Adam Beneschan
2013-04-23 16:52   ` Simon Wright
2013-04-23 17:57     ` Adam Beneschan
2013-04-25  8:48       ` egilhh
2013-04-25 15:19         ` Adam Beneschan [this message]
2013-05-02  2:33         ` Randy Brukardt
2013-05-02  2:38       ` Randy Brukardt
2013-05-02 16:15         ` Adam Beneschan
2013-05-02 22:00           ` Randy Brukardt
2013-05-03  1:11         ` Adam Beneschan
2013-05-03  5:34           ` Simon Wright
2013-05-03  6:43           ` egilhh
2013-05-03 16:49             ` Adam Beneschan
2013-05-03 23:09           ` Randy Brukardt
2013-04-23 23:00     ` Shark8
2013-04-23 23:16       ` Adam Beneschan
2013-05-02  2:28   ` Randy Brukardt
2013-05-02 16:37     ` Adam Beneschan
2013-04-23 16:33 ` Simon Wright
replies disabled

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