Version 1.3 of ais/ai-00333.txt

Unformatted version of ais/ai-00333.txt version 1.3
Other versions for file ais/ai-00333.txt

!standard D.02.02 (05)          04-07-28 AI95-00333/02
!class binding interpretation 03-07-25
!status work item 03-07-25
!status received 03-02-34
!qualifier Clarification
!priority Low
!difficulty Easy
!subject Other Locking_Policies can be used with FIFO_Within_Priorities
!summary
Other Locking_Policies can be used with FIFO_Within_Priorities.
!question
Why does D.2.2(5) require that Ceiling_Locking be used whenever FIFO_Within_Priorities is used?
If an implementation supports another locking policy, why shouldn't it be allowed to combine that policy with FIFO_Within_Priorities?
!recommendation
(See Wording.)
!wording
Replace D.2.2(5) by:
If the FIFO_Within_Priorities policy is specified for a partition, then a Locking_Policy (see D.3) also shall be specified for the partition.
!discussion
There is no identified reason for this restriction.
While analysis of a real-time program requires the use of well-defined locking and dispatching policies, such an application should already be specifying the policies that they are assuming.
Moreover, if an implementation provides its own well-defined policy, why shouldn't it be allowed to combine that policy with FIFO_Within_Priorities? There is no value in forcing an implementation to support a second name for the same dispatching policy just to be able to use a different locking policy.
Thus, we've replaced this restriction by a requirement that some locking policy is specified for a partition with the FIFO_Within_Priorities dispatching policy.
!corrigendum D.2.2(05)
Replace the paragraph:
If the FIFO_Within_Priorites policy is specified for a partition, then the Ceiling_Locking policy shall also be specified for the partition.
by:
If the FIFO_Within_Priorities policy is specified for a partition, then a Locking_Policy (see D.3) also shall be specified for the partition.
!ACATS test
Since this gives more permission, no test is needed. There is no test for the rule that was deleted.
!appendix

This is a question from Robert Dewar.  Note that Robert is not currently
on the ada-comment list, but I'll forward any replies to him.


!topic Why does FIFO_Within_Priorities require the Ceiling_Locking policy?
!reference RM95 D.2.2(5)
!from Robert Dewar 02-24-03

This concerns the rule in D.2.2:

  5   If the FIFO_Within_Priorities policy is specified for a partition, then
  the Ceiling_Locking policy (see D.3) shall also be specified for the
  partition.

We have never enforced this rule, and it seems silly to do so, since I can't
tell why it is there. What possible value is it to make it impossible to mix
different task dispatching policies and queuing policies. It makes no sense
at all, and the AARM gives no hint for the motivation behind this rule.

In standard Ada, these are the only possible values to be specified. If one
specifies FWP, and default ceiling locking, then there are two possibilities:

1. For some reason, the implementation only works out nicely if the default
queuing policy in this case is Ceiling_Locking, fine do it!

2. The default locking policy is something else which works fine with FWP.
So why on earth make this illegal.

In an implementation that introduces additional policies, it makes absolutely
ZERO sense to constrain the implementation in this manner.

I am very reluctant to implement this silly rule, without first asking the ARG
why it is there, and suggesting it be got rid of.

****************************************************************

From: Randy Brukardt
Sent: Wednesday, July 28, 2004 10:10 PM

At the Palma meeting, we straw voted on this AI (I've left out the choices that
were disliked by many):

2) Fifo implies ceiling locking is default: 8-0.
3) Fifo means that some policy must be specified: 6-1.
4) Add an Implementation Requirement that the combination must be
   supported and delete D.2.2(5): 6-0.
...
Narrowing the choices to the three most popular, we take a preference poll.
Prefer (2): 6; Prefer (3): 1; Prefer (4): 2.

The AI should be rewritten to reflect resolution (2).

---

I'm trying to implement this resolution. I came up with the following
replacement for D.2.2(5):

  If the FIFO_Within_Priorities policy is specified for a partition, and
  no Locking_Policy (see D.3) is specified for the partition, then the
  Locking_Policy is Ceiling_Locking.

But I don't much like this, because it seems to be an implementation problem.
If the implementation has any compile-time effects of the locking policy, it
may not know what the policy is until very late during the compilation of the
partition. It could use 10.1.5(9) to restrict Task_Dispatching_Policy *and*
Locking_Policy to the beginning of the environment, but that would be
unfriendly and incompatible if it currently is not required.

I also don't like the "magic" nature of this. We're replacing a requirement
that something be specified a certain way to saying that you don't have to
specify it at all. That doesn't seem very Ada-like; it would make more sense to
require you to say what you mean.

I missed the discussion on this AI (when I arrived, the above list was on the
board, and we immediately took the straw vote then moved on), so I don't know
what the issues discussed were (if any). So that makes it hard to reason about
this. I particularly don't understand where "default" comes from here, because
Ada doesn't currently say or require anything (other than Chapter 9) about the
default policies, and it seems like a big step backwards to start making such
requirements. And there is no compatibility problem to worry about: the current
rule requires both to be specified; what happens if one isn't specified doesn't
matter because it can't happen. Indeed, this change is more likely to introduce
a performance compatibility problem by forcing implementations to make
Ceiling_Locking the default Locking_Policy, which would add overhead in a
simple implementation.

I'd much prefer if D.2.2(5) was replaced by:

  If the FIFO_Within_Priorities policy is specified for a partition, then
  a Locking_Policy (see D.3) also shall be specified for the partition.

which is cleaner and has no magic semantics. However, that is option (3) and
that got  less support at the meeting.

Comments??

****************************************************************


Questions? Ask the ACAA Technical Agent