From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,16594902ce57591b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!grolier!usenet-fr.net!proxad.net!proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Multitasking and containers Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <143yx0dos45nx.159wpxvfevtt8.dlg@40tude.net> <1164623427.5986.11.camel@localhost> <1164656708.657952.123430@j72g2000cwa.googlegroups.com> <1164709873.10405.15.camel@localhost> Date: Tue, 28 Nov 2006 12:24:44 +0100 Message-ID: <8rojzetyj1sh.i4f73l9vdcwc$.dlg@40tude.net> NNTP-Posting-Date: 28 Nov 2006 12:24:45 CET NNTP-Posting-Host: e2cb1223.newsspool3.arcor-online.net X-Trace: DXC=R0glk=egS;O@Y=h<_c3PkHMcF=Q^Z^V3H4Fo<]lROoRAgUcjd<3m<;BQC1b:6McjlA[6LHn;2LCVN7enW;^6ZC`DF0oL 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