Re: protected type interrupts




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?

REH

.



Relevant Pages

  • Re: protected objects and external call
    ... >> This is why it is considered a potentially blocking operation, ... But a protected procedure can call another protected procedure ... > the same protected object. ...
    (comp.lang.ada)
  • Re: Barrier re-evaluation issue with GNAT 4.3.2
    ... this code contains a bounded error. ... the potentially blocking operation was detected, ... Thanks for the clarification and the pointer to the ARM. ...
    (comp.lang.ada)
  • Re: protected type interrupts
    ... Relay_Object.Isr a potentially blocking operation, ... subprograms or entries to get it. ... (and the protected action is supposed to complete very quickly). ...
    (comp.lang.ada)