comp.lang.ada
 help / color / mirror / Atom feed
* subtype of value passed to pragma Interrupt_Priority
@ 1998-09-30  0:00 Pat Rogers
  1998-09-30  0:00 ` Tucker Taft
  1998-10-01  0:00 ` Frank Ecke
  0 siblings, 2 replies; 6+ messages in thread
From: Pat Rogers @ 1998-09-30  0:00 UTC (permalink / raw)


RM 95 D.1(17) says:

"The expression in a Priority or Interrupt_Priority pragma that
appears in a task_definition is evaluated for each task object (see
9.1). For a Priority pragma, the value of the expression is
converted to the subtype Priority; for an Interrupt_Priority pragma,
this value is converted to the subtype Any_Priority. The priority
value is then associated with the task object whose task_definition
contains the pragma."

Why isn't the subtype Interrupt_Priority the target for the
conversion for pragma Interrupt_Priority, instead of subtype
Any_Priority?

I didn't see an AI for this...

-- pat

Patrick Rogers
progers@acm.org
http://www.neosoft.com/~progers






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: subtype of value passed to pragma Interrupt_Priority
  1998-09-30  0:00 subtype of value passed to pragma Interrupt_Priority Pat Rogers
@ 1998-09-30  0:00 ` Tucker Taft
  1998-10-01  0:00 ` Frank Ecke
  1 sibling, 0 replies; 6+ messages in thread
From: Tucker Taft @ 1998-09-30  0:00 UTC (permalink / raw)


Pat Rogers (progers@acm.org) wrote:
: RM 95 D.1(17) says:

: "The expression in a Priority or Interrupt_Priority pragma that
: appears in a task_definition is evaluated for each task object (see
: 9.1). For a Priority pragma, the value of the expression is
: converted to the subtype Priority; for an Interrupt_Priority pragma,
: this value is converted to the subtype Any_Priority. The priority
: value is then associated with the task object whose task_definition
: contains the pragma."

: Why isn't the subtype Interrupt_Priority the target for the
: conversion for pragma Interrupt_Priority, instead of subtype
: Any_Priority?

Because the pragma Interrupt_Priority can be used to specify any priority,
including, but not limited to, priorities in the interrupt range.

Otherwise, if the priority were determined by an expression, and
the value of the expression might or might not be in the interrupt
priority range, there wouldn't be a pragma which you could use.

: I didn't see an AI for this...

: -- pat

: Patrick Rogers
: progers@acm.org
: http://www.neosoft.com/~progers

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: subtype of value passed to pragma Interrupt_Priority
  1998-09-30  0:00 subtype of value passed to pragma Interrupt_Priority Pat Rogers
  1998-09-30  0:00 ` Tucker Taft
@ 1998-10-01  0:00 ` Frank Ecke
  1998-10-01  0:00   ` Pat Rogers
  1 sibling, 1 reply; 6+ messages in thread
From: Frank Ecke @ 1998-10-01  0:00 UTC (permalink / raw)


On Wed, 30 Sep 1998 14:05:57 -0500, Pat Rogers <progers@acm.org> wrote:

> Why isn't the subtype Interrupt_Priority the target for the
> conversion for pragma Interrupt_Priority, instead of subtype
> Any_Priority?

The Rationale says in D.1.3 ``Base Priority Specification'':

``The Interrupt_Priority pragma is also allowed to specify priorities below
interrupt level, so that it is possible to write reusable code modules
containing priority specifications, where the actual priority is a parameter.''

   If the conversion were to Interrupt_Priority, you would not be able to
specify an interrupt priority less than Priority'Last + 1.  Of course, if you
wanted an interrupt to block whatever task is currently running, doing so would
be unwise.


Hope this helps.


Frank

--
Frank Ecke <franke@minet.uni-jena.de>


       In a world without walls and fences, who needs windows and gates?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: subtype of value passed to pragma Interrupt_Priority
  1998-10-01  0:00 ` Frank Ecke
@ 1998-10-01  0:00   ` Pat Rogers
  1998-10-01  0:00     ` Jean-Pierre Rosen
  0 siblings, 1 reply; 6+ messages in thread
From: Pat Rogers @ 1998-10-01  0:00 UTC (permalink / raw)


Frank Ecke wrote in message ...
>On Wed, 30 Sep 1998 14:05:57 -0500, Pat Rogers <progers@acm.org>
wrote:
>
>> Why isn't the subtype Interrupt_Priority the target for the
>> conversion for pragma Interrupt_Priority, instead of subtype
>> Any_Priority?
>
>The Rationale says in D.1.3 ``Base Priority Specification'':
>
>``The Interrupt_Priority pragma is also allowed to specify
priorities below
>interrupt level, so that it is possible to write reusable code
modules
>containing priority specifications, where the actual priority is a
parameter.''

I don't see how the parameterization makes any difference to the
question of why it should be allowed.

>
>   If the conversion were to Interrupt_Priority, you would not be
able to
>specify an interrupt priority less than Priority'Last + 1.

Exactly my puzzlement.  Why should we be able to specify a value
with pragma Interrupt_Priority that is not in subtype
Interrupt_Priority?  Why should that be allowed, parameter or not?

>Hope this helps.

Thanks for pointing out the Rationale's text on the question!  I
haven't looked there in a long time, and should have thought to do
so (although in this case it doesn't shed light for me).






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: subtype of value passed to pragma Interrupt_Priority
  1998-10-01  0:00   ` Pat Rogers
@ 1998-10-01  0:00     ` Jean-Pierre Rosen
  1998-10-02  0:00       ` Robert I. Eachus
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Pierre Rosen @ 1998-10-01  0:00 UTC (permalink / raw)


Pat Rogers a �crit dans le message <6v08fv$l5o$1@uuneo.neosoft.com>...
>Frank Ecke wrote in message ...
>>On Wed, 30 Sep 1998 14:05:57 -0500, Pat Rogers <progers@acm.org>
>wrote:
>>
>>> Why isn't the subtype Interrupt_Priority the target for the
>>> conversion for pragma Interrupt_Priority, instead of subtype
>>> Any_Priority?
>>
>Exactly my puzzlement.  Why should we be able to specify a value
>with pragma Interrupt_Priority that is not in subtype
>Interrupt_Priority?  Why should that be allowed, parameter or not?
>
The idea is that pragma priority should be restricted to "safe" priorities,
but then you need another pragma to access the full range. It was named
"Interrupt_Priority" to remind people that it gave access to interrupt
priorities, but it could have been named
"All_Priorities_Including_Interrupt_Priorities" ... Oh well....





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: subtype of value passed to pragma Interrupt_Priority
  1998-10-01  0:00     ` Jean-Pierre Rosen
@ 1998-10-02  0:00       ` Robert I. Eachus
  0 siblings, 0 replies; 6+ messages in thread
From: Robert I. Eachus @ 1998-10-02  0:00 UTC (permalink / raw)


In article <6v0903$9qp$1@platane.wanadoo.fr> "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr> writes:

  > The idea is that pragma priority should be restricted to "safe" priorities,
  > but then you need another pragma to access the full range. It was named
  > "Interrupt_Priority" to remind people that it gave access to interrupt
  > priorities, but it could have been named
  > "All_Priorities_Including_Interrupt_Priorities" ... Oh well....

  Or Unchecked_Priorities... ;-)
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1998-10-02  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-30  0:00 subtype of value passed to pragma Interrupt_Priority Pat Rogers
1998-09-30  0:00 ` Tucker Taft
1998-10-01  0:00 ` Frank Ecke
1998-10-01  0:00   ` Pat Rogers
1998-10-01  0:00     ` Jean-Pierre Rosen
1998-10-02  0:00       ` Robert I. Eachus

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