From: Simon Wright <simon@pushface.org>
Subject: Re: time of update of new values for out mode parameters
Date: Tue, 20 Mar 2018 05:54:46 +0000
Date: 2018-03-20T05:54:46+00:00 [thread overview]
Message-ID: <lyy3infg0p.fsf@pushface.org> (raw)
In-Reply-To: 13e52a81-4991-4361-9e1b-c9673faebaec@googlegroups.com
Mehdi Saada <00120260a@gmail.com> writes:
> Ok. To be honest, the use case I had in mind was a wrong one, is meant
> to be implemented through protected types.
>
> let's say:
> procedure FOO (A: out A_TYPE) is
> ... A := something; -- Can't know when it's copied back
> procedure FOO2 (a: access A_TYPE) is
> ... A.all := something; -- Can't know for sure either, right ?
All you can say is that it will have been copied out by the time you've
returned from the calls. But that must be enough; if there were two
threads making the different calls, how would you be able to tell which
made the earlier call?
> but I am sure with
> until some_absolute_time; some_protected_object.Write(something);
> , and another task can use it safely.
> Now, about procedure FOO (A: out A_TYPE) is
> ... delay until some_absolute_time;
> A := something; delay until the_other_hour;
You are seriously overthinking this.
> I shall assume that inside FOO, A = something" (obviously), but shall
> not assume this for the world outside FOO ?
At the level of Ada code, you have to assume this. How could you
possibly write any sort of reliable program if it were otherwise>?
next prev parent reply other threads:[~2018-03-20 5:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 12:21 time of update of new values for out mode parameters Mehdi Saada
2018-03-19 13:10 ` Simon Clubley
2018-03-19 15:01 ` AdaMagica
2018-03-19 16:11 ` Mehdi Saada
2018-03-19 17:09 ` AdaMagica
2018-03-19 22:42 ` Randy Brukardt
2018-03-20 2:33 ` Mehdi Saada
2018-03-20 5:54 ` Simon Wright [this message]
2018-03-20 11:18 ` Mehdi Saada
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox