Re: protected type interrupts
- From: "Adam Beneschan" <adam@xxxxxxxxxx>
- Date: 24 Aug 2006 14:16:11 -0700
REH wrote:
Adam Beneschan wrote:
REH wrote:
Thanks for the reference. Is your work-around valid? Isn't calling
Relay_Object.Isr a potentially blocking operation, and thus a bad thing
to do in an interrupt?
I don't think it's potentially blocking... Relay_Object.Isr is a
procedure, and as I read 9.5.1, a call to a protected *procedure* is
not a potentially blocking operation unless it's done from the same
protected object. A call on a protected *entry* would be potentially
blocking. [This is from the Ada 95 manual. If this has changed in Ada
0Y, I can't tell because www.adaic.com isn't responding.]
I don't understand. How can a procedure within a protected object
modify data internal to the object in a thread-safe way without the
potentially blocking effect of enforcing mutual exclusion? If one task
is "using" the object, and another calls one of the object's
procedures, would the second task not be blocked until the first one
exits the object?
I'm just reading what the RM says. But, although I'm not an expert at
this, I don't believe your argument makes sense given the way protected
objects are supposed to work. A task cannot, of course, access data
internal to a protected object directly; it has to call one of the PO's
subprograms or entries to get it. When it does so, then assuming
Ceiling_Locking is in effect, no other task can use the PO---but it's
not because other tasks are blocked, it's simply because the protected
action runs at a higher priority than any task that could use the PO
(and the protected action is supposed to complete very quickly). So no
mutual exclusion or blocking is necessary when calling protected
subprograms. At least I think that's how it works.
-- Adam
.
- Follow-Ups:
- Re: protected type interrupts
- From: Jean-Pierre Rosen
- Re: protected type interrupts
- From: REH
- Re: protected type interrupts
- References:
- protected type interrupts
- From: REH
- Re: protected type interrupts
- From: Jean-Pierre Rosen
- Re: protected type interrupts
- From: REH
- Re: protected type interrupts
- From: Adam Beneschan
- Re: protected type interrupts
- From: REH
- protected type interrupts
- Prev by Date: Re: call procedure in Linux-Ada-module from "normal" program
- Next by Date: Re: protected type interrupts
- Previous by thread: Re: protected type interrupts
- Next by thread: Re: protected type interrupts
- Index(es):
Relevant Pages
|