comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Multitasking and containers
Date: Tue, 28 Nov 2006 12:24:44 +0100
Date: 2006-11-28T12:24:45+01:00	[thread overview]
Message-ID: <8rojzetyj1sh.i4f73l9vdcwc$.dlg@40tude.net> (raw)
In-Reply-To: 1164709873.10405.15.camel@localhost

On Tue, 28 Nov 2006 11:31:13 +0100, Georg Bauhaus wrote:

> On Tue, 2006-11-28 at 09:50 +0100, Dmitry A. Kazakov wrote:
>> On Tue, 28 Nov 2006 02:19:55 GMT, Matthew Heaney wrote:
>>  It is easy to imagine a
>> situation (massively parallel computing with shared memory) where the loss
>> could be huge.
> 
> I have learned that Ada tasking is defined at a relatively
> high level. Suppose you are writing highly specialized low
> level software, such as when taking advantage of a specific
> computer's architecture at the system or hardware level.
> It is easy for me to imagine that you are working way below
> Ada's tasking level. Are you suggesting that this is the
> normal mode of using a high level programming language
> that supports tasking?

I didn't mean Ada tasking at all [*]. I meant explicitly one concrete
design solution: a container with mutable reads wrapped into a protected
object's procedure.

What makes you think that my proposal to decouple the mutable context from
the container data type is any lower level than fighting with side-effects
by rough locking? It is merely a design question. You replace:

   function Find
            (  Container : access Dictionary;
               Token     : Key
            )  return Topic;

with

   function Find
            (  Container : Dictionary;
               Token     : Key;
               Context   : access Environment
            )  return Topic;

where Context provides protected interface to shared mutable data, which
hopefully need not to changed upon each call.

or else you use mix-in on the container type:

   type Dictionary (Context : access Environment) is ...;

-------------------------------------------
*  If your question concerns whether Ada's tasking primitives are
composable with other language features. Then the answer is clear and
unambiguous. They are *not*.

There are many *objective* reasons for this unhappy situation. Objective in
the sense that it would be unfair and just wrong to address them to the
language design faults. If you disagree with that, then you should have
dismissed the design of Ada.Containers for being task-unsafe. Because the
following two statements are mutually incompatible:

1. Ada.Containers may be task-unsafe
2. Ada tasking primitives are composable

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2006-11-28 11:24 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24  8:51 Multitasking and containers Maciej Sobczak
2006-11-24 10:11 ` Georg Bauhaus
2006-11-24 10:19 ` Dmitry A. Kazakov
2006-11-24 10:35   ` Maciej Sobczak
2006-11-24 11:14     ` Dmitry A. Kazakov
2006-11-24 12:13       ` Matthew Heaney
2006-11-27  4:17         ` Jeffrey R. Carter
2006-11-27 10:30           ` Georg Bauhaus
2006-11-27 18:41             ` Jeffrey R. Carter
2006-11-27 18:57               ` Dmitry A. Kazakov
2006-11-27 19:45               ` Matthew Heaney
2006-11-27 21:15                 ` Simon Wright
2006-11-28  1:43                 ` Dr. Adrian Wrigley
2006-11-28  2:19                   ` Matthew Heaney
2006-11-28  8:50                     ` Dmitry A. Kazakov
2006-11-28 10:31                       ` Georg Bauhaus
2006-11-28 11:24                         ` Dmitry A. Kazakov [this message]
2006-11-29  8:51                           ` Georg Bauhaus
2006-11-28 17:12                       ` Matthew Heaney
2006-11-28 18:21                         ` Dmitry A. Kazakov
2006-11-28 19:17                           ` Matthew Heaney
2006-11-29 18:43                             ` Dmitry A. Kazakov
2006-11-29 10:14                       ` Maciej Sobczak
2006-11-29 15:50                         ` Matthew Heaney
2006-11-24 12:12     ` Matthew Heaney
2006-11-24 12:05   ` Matthew Heaney
2006-11-24 12:02 ` Matthew Heaney
replies disabled

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