comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Waiver question
Date: 1997/05/02
Date: 1997-05-02T00:00:00+00:00	[thread overview]
Message-ID: <E9KA78.DxH@world.std.com> (raw)
In-Reply-To: 1997May2.063334.1@eisner


In article <1997May2.063334.1@eisner>,
Larry Kilgallen <kilgallen@eisner.decus.org> wrote:
>I do not understand why you feel the default should be task-unsafe.
>The general trend in Ada seems to be that safeguards are enabled by
>default and disabled by explicit statement.

I agree with that general language design principle.  Mostly, Ada
follows it, and that's usually good.  In some cases, Ada disobeys this
principle, and that's usually bad.  (For example, Ada requires extra
effort to declare a constant, rather than a variable -- it should be the
other way 'round; that is, "X: Integer := 7;" would be a constant,
whereas "X: var Integer := 7;" would be a variable (or "X: variable
Integer := 7;", if you hate abbreviations).  Interestingly, Ada is
inconsistent on this point -- for a parameter, the default is "in",
which means it's constant.)

Anyway, back to the point:  Independent addressability does not imply
task-safety.  So, if variables are not automatically protected by
locking/synchronization by default, it seems to me that they should not
have to be independently addressable by default.

In keeping with the principle you describe, above, I think I would
prefer a language in which any variable that is potentially shared by
multiple tasks would have to be explicitly declared "shared".  But to do
that, you would need a good deal of extra mechanism.  For example,
subprogram specs would need to be annotated with some syntax that says
"I modify shared variables" or whatever.  In the absence of such
mechanisms, Ada defaults to task-unsafe -- if you want locking of some
sort, you have to say so, and if you don't, you're erroneous.  Any
variable is potentially shared, and any use of shared variables requires
a great deal of care.  Given that, it seems that independent
addressability should also default to the "unsafe" way.

Anyway, my main point was that independent addressability should not be
turned on and off by pragma Pack.  These should be two independent
features.  I don't feel strongly, one way or the other, about what the
default should be, and I'm partly convinced by your argument above.

>The only wasted resource is memory, and typical applications on
>Alpha have lots.

I don't buy this reasoning.  Wasting space will typically cause you to
waste time, too, due to caching and paging.  So it's not true that "Now
that memory is cheap, we can squander it."

- Bob




  reply	other threads:[~1997-05-02  0:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-18  0:00 Waiver question Ken Garlington
1997-04-19  0:00 ` Tom Moran
1997-04-20  0:00 ` Robert Dewar
1997-04-21  0:00   ` Ken Garlington
1997-04-22  0:00     ` Ken Garlington
1997-04-23  0:00       ` Corey Minyard
1997-04-24  0:00         ` Richard Kenner
1997-04-28  0:00         ` Larry Kilgallen
1997-04-28  0:00           ` Corey Minyard
1997-04-29  0:00             ` Kaz Kylheku
1997-04-29  0:00             ` Robert Dewar
1997-04-29  0:00             ` Laurent Guerby
1997-04-30  0:00               ` Corey Minyard
1997-04-29  0:00           ` Robert Dewar
1997-04-29  0:00           ` Richard Kenner
1997-04-30  0:00             ` Robert Dewar
1997-05-01  0:00               ` Larry Kilgallen
1997-05-07  0:00                 ` Bad .diff files in gnat-3.09 in Linux Benoit Jauvin-Girard
1997-05-09  0:00                   ` Albert K. Lee
1997-04-30  0:00             ` Waiver question Robert A Duff
1997-05-01  0:00               ` Kaz Kylheku
1997-05-02  0:00                 ` Robert A Duff
1997-05-02  0:00                   ` Larry Kilgallen
1997-05-02  0:00                     ` Robert A Duff [this message]
1997-05-02  0:00                       ` Larry Kilgallen
1997-05-03  0:00                         ` Robert A Duff
1997-05-03  0:00                           ` Larry Kilgallen
1997-05-04  0:00                             ` Robert Dewar
1997-05-04  0:00                         ` Robert Dewar
1997-05-02  0:00                     ` Robert Dewar
1997-05-06  0:00                     ` John M. Mills
1997-04-23  0:00     ` Tarjei Jensen
1997-04-20  0:00 ` Steve Doiel
1997-04-20  0:00 ` Dean Runzel
1997-04-22  0:00   ` Ken Garlington
1997-04-21  0:00 ` Robert I. Eachus
1997-04-21  0:00   ` Robert Dewar
1997-04-22  0:00     ` Robert I. Eachus
1997-04-23  0:00       ` Robert Dewar
1997-04-22  0:00   ` Ken Garlington
1997-04-23  0:00     ` Robert S. White
1997-04-24  0:00     ` Robert Dewar
1997-04-24  0:00       ` Steve Vestal
1997-04-25  0:00         ` Robert I. Eachus
1997-04-25  0:00         ` Ken Garlington
replies disabled

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