comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Writing an Operating System in Ada
Date: Thu, 14 Jan 2010 19:24:41 -0600
Date: 2010-01-14T19:24:41-06:00	[thread overview]
Message-ID: <hiog4q$h3o$1@munin.nbi.dk> (raw)
In-Reply-To: 1fhgwtz4ezt52.zvep41elk4lq.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:1fhgwtz4ezt52.zvep41elk4lq.dlg@40tude.net...
> On Thu, 14 Jan 2010 13:07:08 -0800 (PST), Shark8 wrote:
...
>>> You have to be able to derive from a task, that is what active objects 
>>> are.
>>> BTW, you already can do this in Ada 2005. It has task interfaces, but 
>>> this
>>> inheritance is limited to have the depth of 1.
>>
>> I remember reading that now... but is an inheritance level of 1 good
>> enough?
>
> No, it is not. The bottom level is an interface, a quite useless thing
> because it does not provide implementation. The next level is a concrete
> implementation. The train stops there.

You're confusing inheritance of interfaces with inheritance of 
implementation. One of the most important parts of Ada is that it tries to 
strongly separate interfaces and implementation. [I know you know this 
difference, but are purposely ignoring it.]

You can have as much inheritance of interfaces as you want (as you showed in 
your read/write example).

Ada doesn't allow inheritance of implementation for synchronized objects, 
for the very good reason that no one knows how to make inheritance rules 
that doesn't violate the exclusion and ordering rules. We tried for a quite 
a while to make a version of inheritable protected types, but it always led 
to deadlocks, race conditions, or loss of exclusion. (Java has this problem 
in spades.)

We looked at some ideas for very limited inheritance, but it would have been 
quite complex. We didn't think anyone would understand the rules (they 
surely were not intuitive).

By not allowing inheritance at all, we keep all of the mutual exclusion in a 
single object where analysing it for problems is at least possible. Since 
subprogram calls are possible for the sequential code, it doesn't 
necessarily have to be duplicated (although most of the synchronized 
interface objects that we see are quite simple, as anything complex is 
pretty much a lost cause at the start).

Someday the state of the art might change; by not doing anything in Ada 2005 
we left open the possibility for doing it right (whatever that turns out to 
mean) in the future; had we done a lousy job in 2005, we couldn't have 
replaced it in the future without breaking a lot of existing code (which we 
won't do).

                               Randy.







  reply	other threads:[~2010-01-15  1:24 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-12  1:13 Writing an Operating System in Ada Shark8
2010-01-12  3:30 ` Leslie
2010-01-12  7:06   ` Shark8
2010-01-12  8:36     ` Ludovic Brenta
2010-01-12 15:14       ` jonathan
2010-01-12 16:21   ` Colin Paul Gloster
2010-01-12 16:36     ` Shark8
2010-01-12 17:03       ` Colin Paul Gloster
2010-01-12 19:07     ` Tero Koskinen
2010-01-12  9:41 ` Dmitry A. Kazakov
2010-01-12 17:37   ` Shark8
2010-01-12 19:56     ` Dmitry A. Kazakov
2010-01-12 21:21       ` Shark8
2010-01-12 22:39         ` nobody
2010-01-12 22:50           ` Shark8
2010-01-15 22:45             ` nobody
2010-01-19 21:09               ` Shark8
2010-01-12 21:52       ` Maciej Sobczak
2010-01-12 23:26         ` Shark8
2010-01-13  9:17         ` Dmitry A. Kazakov
2010-01-13 20:20           ` Shark8
2010-01-13 20:55             ` Dmitry A. Kazakov
2010-01-13 22:50               ` Shark8
2010-01-14  8:55                 ` Dmitry A. Kazakov
2010-01-14 18:01                   ` Shark8
2010-01-14 19:04                     ` tmoran
2010-01-19 19:07                       ` Shark8
2010-01-14 19:53                     ` Dmitry A. Kazakov
2010-01-14 21:07                       ` Shark8
2010-01-14 21:50                         ` Dmitry A. Kazakov
2010-01-15  1:24                           ` Randy Brukardt [this message]
2010-01-15  8:59                             ` Dmitry A. Kazakov
2010-01-19 18:58                   ` Shark8
2010-01-19 19:43                     ` Dmitry A. Kazakov
2010-01-14  9:40           ` Maciej Sobczak
2010-01-14 10:28             ` Dmitry A. Kazakov
2010-01-14 18:57               ` tmoran
2010-01-14 19:19                 ` Dmitry A. Kazakov
2010-01-14 20:33                   ` Georg Bauhaus
2010-01-14 21:09                     ` Dmitry A. Kazakov
2010-01-14 21:50               ` Maciej Sobczak
2010-01-15  8:37                 ` Dmitry A. Kazakov
2010-01-15 21:05                   ` Maciej Sobczak
2010-01-15 21:48                     ` Dmitry A. Kazakov
2010-01-16 21:18                       ` Maciej Sobczak
2010-01-16 22:15                         ` Dmitry A. Kazakov
2010-01-18 11:23                           ` Georg Bauhaus
2010-01-18 13:50                             ` Dmitry A. Kazakov
2010-01-18 15:21                               ` Georg Bauhaus
2010-01-18 16:41                                 ` Dmitry A. Kazakov
2010-01-18 17:17                                   ` Georg Bauhaus
2010-01-18 18:08                                     ` Dmitry A. Kazakov
2010-01-19 17:41         ` Writing an Operating System in Ada - now off topic? Leslie
2010-01-13  9:09       ` Writing an Operating System in Ada Georg Bauhaus
2010-01-13  9:27         ` Dmitry A. Kazakov
2010-01-13  3:38     ` Leslie
2010-01-13 12:10       ` Martin
2010-01-13 18:55       ` Ad Buijsen
2010-01-14  9:12       ` Jean-Pierre Rosen
2010-01-14 10:45         ` Dmitry A. Kazakov
2010-01-14 11:31           ` Jean-Pierre Rosen
2010-01-14 13:47             ` Dmitry A. Kazakov
2010-01-14 18:57         ` tmoran
2010-01-13  4:49   ` Hibou57 (Yannick Duchêne)
2010-01-13 17:29 ` Lucretia
2010-01-13 20:37   ` Shark8
2010-01-16  0:13     ` Lucretia
replies disabled

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