comp.lang.ada
 help / color / mirror / Atom feed
From: "Pat Rogers" <progers@classwide.com>
Subject: Re: Ceiling priority and priority inversion
Date: Mon, 02 Sep 2002 15:51:33 GMT
Date: 2002-09-02T15:51:33+00:00	[thread overview]
Message-ID: <9OLc9.12727$6U1.3212496070@newssvr11.news.prodigy.com> (raw)
In-Reply-To: 9b051957.0209020707.562bdac4@posting.google.com

"Mathias" <l_mathias@hotmail.com> wrote in message
news:9b051957.0209020707.562bdac4@posting.google.com...
> I an pretty new with Ada and wonder if someone out there can help me
clarify
> how the pragma Locking_Policy(Ceiling_Priority) works.
<snip>
> Let's say for an example that the protected object is a buffer
shared
> between a number of tasks, among which one is a  low priority
application
> task and another is an interrupt handler. Using Ceiling_Priority
will cause
> all tasks executing within the protected object do so with interrupt
> priority. Doesn't this potentially cause a kind of priority
inversion? When
> the application task executes within the buffer it preempts all
other tasks
> in the system, even interrupts.

Interrupts at that level or below, yes.  With the design you describe,
that's what you want -- while the accessing task is within the PO you
don't want another of those interrupts to be handled and you don't
want any other tasks accessing the encapsulated data within the PO.
That's probably OK since interrupt handlers should be short and sweet.

> Shouldn't it instead work like the following? If a low priority task
is
> executing within a protected object and a task with a higher
priority tries
> to gain access this object. Then the low priority task should be
raised to
> the priority level of the waiting task. But if there is no
concurrent access
> the low priority task executes with its base priority.

Ada uses the *Immediate* Ceiling Priority Protocol, because it is more
efficient to implement.


--
Patrick Rogers                       Consulting and Training in:
http://www.classwide.com       Real-Time/OO Languages
progers@classwide.com          Hard Deadline Schedulability Analysis
(281)648-3165                            Software Fault Tolerance





  reply	other threads:[~2002-09-02 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-02 15:07 Ceiling priority and priority inversion Mathias
2002-09-02 15:51 ` Pat Rogers [this message]
2002-09-02 16:26 ` Jim Rogers
replies disabled

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