comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Protected types
Date: Thu, 18 Jan 2001 22:54:12 GMT
Date: 2001-01-18T22:54:12+00:00	[thread overview]
Message-ID: <3A667815.CABC49B9@acm.org> (raw)
In-Reply-To: 944hnf$3nh$1@nnrp1.deja.com

Adam Beneschan wrote:
> 
> Question I: 9.5.1(4) says "A new protected action is not started on a
> protected object while another protected action on the same protected
> object is underway, unless both actions are the result of a call on a
> protected function."
> 
> Consider a case where Ceiling_Locking does not apply.  Task T1 starts
> a call on a protected function P.F1 (P is a protected object).  While
> P.F1 is still in progress, task T2 tries to call a protected procedure
> P.P2.  Clearly the call cannot start.  So T2 has to wait until it can
> call the procedure.  Now, while P.F1 is still in progress and task T2
> is still waiting, task T3 calls another protected function P.F3.
> Which of the following is true?
> 
> (1) The call to P.F3 is started immediately, while T2 is still waiting
>     to call P.P2.
> (2) Task T3 must wait until T1's call to P.F1, and then T2's call to
>     P.P2, are completed.
> (3) It isn't defined by the language, and either (1) or (2) can
>     happen.  Or, it would be defined by an implementation-defined
>     Locking_Policy.

The ARM allows protected functions to proceed simultaneously, but does
not require it. So the answer is that it's implementation defined.
Another possibility is that T3 waits for T1's call to P.F1 to complete,
then T3's call to P.F3 executes, followed by T2's call to P.P2.

> Side question: My reading of the manual is that this situation cannot
> occur on a single-processor system with Ceiling_Locking; is my
> understanding correct?

This is my understanding also. No task with a priority <= P's ceiling
priority is allowed to run while T1's call to P.F1 is running. No task
with a priority > P's ceiling priority may call any of P's operations.

-- 
Jeff Carter
"Death awaits you all, with nasty, big, pointy teeth!"
Monty Python & the Holy Grail




      reply	other threads:[~2001-01-18 22:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-17 16:37 Protected types Adam Beneschan
2001-01-18 22:54 ` Jeffrey Carter [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