Re: protected type interrupts



Adam Beneschan a écrit :
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.

Hmmm... yes, as long as you are running on a mono-processor. But the rules must take care of multi-processors, too. In that case, there is some blocking, but it can be implemented by spin-locking, thus avoiding context switches (see my previous message).

--
---------------------------------------------------------
J-P. Rosen (rosen@xxxxxxxxx)
Visit Adalog's web site at http://www.adalog.fr
.



Relevant Pages

  • Re: protected type interrupts
    ... Adam Beneschan wrote: ... A task cannot, of course, access data ... subprograms or entries to get it. ... (and the protected action is supposed to complete very quickly). ...
    (comp.lang.ada)
  • Re: Ada.Text_IO and protected objects (Was: [newbie question] tasks and protected types)
    ... > Certain language-defined subprograms are potentially blocking. ... should be put in a protected object or inversely they shouldn't. ...
    (comp.lang.ada)
  • Re: Barrier re-evaluation issue with GNAT 4.3.2
    ... The protected action is quite limited to what you could do there. ... potentially blocking and clouds the example, ... This would mean that the hardware device encapsulated that task (e.g. HDD ... something to coordinate multiple tasks and ensure that signalling events ...
    (comp.lang.ada)
  • Re: Ada.Text_IO and protected objects
    ... > should be put in a protected object or inversely they shouldn't. ... "Potentially blocking" subprograms should not be called from ... example of how to solve the combination of tasking and IO. ...
    (comp.lang.ada)