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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1a44c40a66c293f3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.karotte.org!news2.arglkargh.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: PAR (Was: Embedded languages based on early Ada) Date: Fri, 9 Mar 2007 19:58:53 -0600 Organization: Jacob's private Usenet server Message-ID: References: <1172192349.419694.274670@k78g2000cwa.googlegroups.com> <113ls6wugt43q$.cwaeexcj166j$.dlg@40tude.net> <1i3drcyut9aaw.isde6utlv6iq.dlg@40tude.net> <1c61jqeqo68w$.2irtg70stnsa.dlg@40tude.net> <1vdieyr16h7ct$.1vuvfmghy8dzo$.dlg@40tude.net> <1l5727owshrjf$.uuylbc4ek430.dlg@40tude.net> <45EF1E2B.2020703@obry.net> <1jlhu0mtzerde.1m8xbk8idroav$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1173491830 1381 69.95.181.76 (10 Mar 2007 01:57:10 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 10 Mar 2007 01:57:10 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Xref: g2news1.google.com comp.lang.ada:14444 Date: 2007-03-09T19:58:53-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1jlhu0mtzerde.1m8xbk8idroav$.dlg@40tude.net... > On Wed, 7 Mar 2007 23:45:23 -0600, Randy Brukardt wrote: ... > > A "declared parallel type" would be a private type that had a pragma that > > declared that all of it's operations were task-safe. (That's needed to > > provide containers that could be used in parallel subprograms, for > > instance.) Precisely what that would mean, I'll leave for some other time. > > (It would be possible to survive without this, as you could try to use > > protected objects and interfaces for everything. That sounds like a pain to > > me...) > > That's the big question. Is task-safety a type property or one of the > object? For Ada, it's clearly of the type except for elementary types (for which you can declare objects atomic). > The fine-granularity approach presumes that task-safety could be > hung on objects later on, i.e. sort of: > > declare parallel in parallel -- (:-)) > I : Integer; -- Same as if it were declared atomic I don't believe this statement; I don't see any reason that you couldn't use the Ada approach with fine-grained parallelism. > Since Ada 83 the language moved in the opposite direction, IMO. I suppose > because there was no obvious way of making an unsafe ADT safe. Right. > The problem with the container types (and all other more or less elaborated > types) is that fine-granularity concurrency does not work for them. That > was the reason of my original claim that PAR were worth of nothing without > a feasible concept of synchronization somehow different from protected > actions and rendezvous we have by now. But it surely is possible to design ADTs that *do* work with fine-grained (and heavy-grained!) parallelism. That requires some locking (I usually use explicit locks, because I want to control the behavior in ways that protected objects aren't good at. The locks are safe in that I always use controlled locks that lock when initialized and unlock when finalized, so that they don't get held forever if an exception or abort happens). I certainly agree you can't add that sort of stuff later: it has to be baked in right away - it's a critical part of the design. And if you have parallel-safe ADTs, then fine-grained parallelism should work, and it ought to be easier to program than traditional Ada tasks, as there wouldn't be any explicit control flow interactions. So it seems interesting to pursue... Randy.