comp.lang.ada
 help / color / mirror / Atom feed
* Protected Objects - eggshell model
@ 2008-12-23 22:08 hesobreira
  2008-12-24  0:43 ` Adam Beneschan
  2008-12-24  0:49 ` Robert A Duff
  0 siblings, 2 replies; 4+ messages in thread
From: hesobreira @ 2008-12-23 22:08 UTC (permalink / raw)


This was not clear to me while reading Barnes' book about protected
types.

There are two conditions that must be satisfied in order to execute
the entry call: no other task accessing the object at the same time
and the condition barrier evaluated to TRUE (eggshell, or two level
protection model). My question is: which one of these conditions is
evaluated first, the access lock or the condition barrier?

Thank you all in advance,
Hugo



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Protected Objects - eggshell model
  2008-12-23 22:08 Protected Objects - eggshell model hesobreira
@ 2008-12-24  0:43 ` Adam Beneschan
  2008-12-25 14:29   ` hesobreira
  2008-12-24  0:49 ` Robert A Duff
  1 sibling, 1 reply; 4+ messages in thread
From: Adam Beneschan @ 2008-12-24  0:43 UTC (permalink / raw)


On Dec 23, 2:08 pm, hesobreira <herrsobre...@gmail.com> wrote:
> This was not clear to me while reading Barnes' book about protected
> types.
>
> There are two conditions that must be satisfied in order to execute
> the entry call: no other task accessing the object at the same time
> and the condition barrier evaluated to TRUE (eggshell, or two level
> protection model). My question is: which one of these conditions is
> evaluated first, the access lock or the condition barrier?
>
> Thank you all in advance,
> Hugo

The access lock has to be obtained first, and in fact the task calling
the protected entry has to have the protected object all to itself
while it's evaluating the entry barrier.  If the barrier is closed
(False), the entry call is added to a queue, and *then* the lock is
relinquished.

In the RM, the concept of access locking is expressed by the phrase
"protected actions".  See 9.5.1(4-7) and 9.5.3(8-12).

                            -- Adam



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Protected Objects - eggshell model
  2008-12-23 22:08 Protected Objects - eggshell model hesobreira
  2008-12-24  0:43 ` Adam Beneschan
@ 2008-12-24  0:49 ` Robert A Duff
  1 sibling, 0 replies; 4+ messages in thread
From: Robert A Duff @ 2008-12-24  0:49 UTC (permalink / raw)


hesobreira <herrsobreira@gmail.com> writes:

> This was not clear to me while reading Barnes' book about protected
> types.
>
> There are two conditions that must be satisfied in order to execute
> the entry call: no other task accessing the object at the same time
> and the condition barrier evaluated to TRUE (eggshell, or two level
> protection model). My question is: which one of these conditions is
> evaluated first, the access lock or the condition barrier?

The barrier is likely looking at variables that are protected by the
lock.  So the lock must be obtained first.

- Bob



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Protected Objects - eggshell model
  2008-12-24  0:43 ` Adam Beneschan
@ 2008-12-25 14:29   ` hesobreira
  0 siblings, 0 replies; 4+ messages in thread
From: hesobreira @ 2008-12-25 14:29 UTC (permalink / raw)


It is all clear now.

Thank you (Adam and Bob) for the answers and thanks for the references
to the RM.

Hugo

On Dec 24, 1:43 am, Adam Beneschan <a...@irvine.com> wrote:
> On Dec 23, 2:08 pm, hesobreira <herrsobre...@gmail.com> wrote:
>
> > This was not clear to me while reading Barnes' book about protected
> > types.
>
> > There are two conditions that must be satisfied in order to execute
> > the entry call: no other task accessing the object at the same time
> > and the condition barrier evaluated to TRUE (eggshell, or two level
> > protection model). My question is: which one of these conditions is
> > evaluated first, the access lock or the condition barrier?
>
> > Thank you all in advance,
> > Hugo
>
> The access lock has to be obtained first, and in fact the task calling
> the protected entry has to have the protected object all to itself
> while it's evaluating the entry barrier.  If the barrier is closed
> (False), the entry call is added to a queue, and *then* the lock is
> relinquished.
>
> In the RM, the concept of access locking is expressed by the phrase
> "protected actions".  See 9.5.1(4-7) and 9.5.3(8-12).
>
>                             -- Adam




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-25 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-23 22:08 Protected Objects - eggshell model hesobreira
2008-12-24  0:43 ` Adam Beneschan
2008-12-25 14:29   ` hesobreira
2008-12-24  0:49 ` Robert A Duff

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