comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: PAR (Was: Embedded languages based on early Ada)
Date: Sat, 10 Mar 2007 10:11:51 +0100
Date: 2007-03-10T10:11:35+01:00	[thread overview]
Message-ID: <1q1ocwe0qi51q$.1qsmb4h16h364$.dlg@40tude.net> (raw)
In-Reply-To: est39m$1b5$1@jacob-sparre.dk

On Fri, 9 Mar 2007 19:58:53 -0600, Randy Brukardt wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:1jlhu0mtzerde.1m8xbk8idroav$.dlg@40tude.net...

>> 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.

Because it would not be magical! (:-)) In my understanding the idea of
fine-grained parallelism is similar to instruction pipelining. I don't need
to care about it when I write an Ada program. I define the constraints in
which the compiler/CPU may move (the language semantics) and let them
figure out the path they would go. If I had to care about it, that would
not be "fine" anymore.

>> 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.

Sure, the language must be self-consistent, so any forms of parallelism
must be mutually compatible.

> 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.

The problems with locks are:

1. Semaphores are low-level exposed to the danger deadlocks

2. Priority inversion issues

3. They rely on computationally heavy OS calls and resources

4. Controlled objects used to access locks are slow (OK, that's Ada
problem, it need not to be so, and can be fixed)

I think that for expressing "magical" parallelism one would inevitably need
some "magical" synchronization tools as well...

> 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...

Yes

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



  reply	other threads:[~2007-03-10  9:11 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23  0:59 Preferred OS, processor family for running embedded Ada? Mike Silva
2007-02-23  4:41 ` Steve
2007-02-23 16:00   ` Mike Silva
2007-02-23  4:49 ` Jeffrey R. Carter
2007-02-23 13:13   ` Mike Silva
2007-02-23 13:56 ` Stephen Leake
2007-02-23 14:10   ` Mike Silva
2007-02-24 10:45     ` Stephen Leake
2007-02-24 12:27       ` Jeffrey Creem
2007-02-24 22:10         ` Dr. Adrian Wrigley
2007-02-25 13:10           ` roderick.chapman
2007-02-25 17:53             ` Jeffrey R. Carter
2007-02-25 15:08           ` Stephen Leake
2007-02-28 17:20             ` Embedded languages based on early Ada (from "Re: Preferred OS, processor family for running embedded Ada?") Colin Paul Gloster
2007-03-01  9:18               ` Jean-Pierre Rosen
2007-03-01 11:22               ` Dr. Adrian Wrigley
2007-03-01 11:47                 ` claude.simon
2007-03-01 13:57                 ` Dmitry A. Kazakov
2007-03-01 18:09                   ` Ray Blaak
2007-03-02 11:36                   ` Dr. Adrian Wrigley
2007-03-02 16:32                     ` Dmitry A. Kazakov
2007-03-03  0:00                       ` Dr. Adrian Wrigley
2007-03-03 11:00                         ` Dmitry A. Kazakov
2007-03-03 11:27                           ` Jonathan Bromley
2007-03-03 12:12                             ` Simon Farnsworth
2007-03-03 14:07                               ` Dr. Adrian Wrigley
2007-03-03 17:28                                 ` Pascal Obry
2007-03-03 18:11                                   ` Dmitry A. Kazakov
2007-03-03 18:31                                     ` Pascal Obry
2007-03-03 20:26                                       ` Dmitry A. Kazakov
2007-03-03 21:28                                   ` Dr. Adrian Wrigley
2007-03-03 22:00                                     ` Pascal Obry
2007-03-03 13:40                             ` Dr. Adrian Wrigley
2007-03-03 15:26                               ` Jonathan Bromley
2007-03-03 16:59                                 ` Dr. Adrian Wrigley
2007-03-05 15:36                               ` Colin Paul Gloster
2007-03-03  1:58                       ` Ray Blaak
2007-03-03  8:14                         ` Pascal Obry
2007-03-03 11:00                         ` Dmitry A. Kazakov
2007-03-03 21:13                           ` Ray Blaak
2007-03-05 19:01                             ` PAR (Was: Embedded languages based on early Ada) Jacob Sparre Andersen
2007-03-06  2:01                               ` Dr. Adrian Wrigley
2007-03-06  3:30                                 ` Randy Brukardt
2007-03-06  7:10                                   ` Ray Blaak
2007-03-06 18:05                                     ` Ray Blaak
2007-03-06  6:04                                 ` tmoran
2007-03-06  6:59                                 ` Ray Blaak
2007-03-06  7:07                                 ` Ray Blaak
2007-03-06  7:22                                 ` Martin Krischik
2007-03-06 13:18                                 ` Dr. Adrian Wrigley
2007-03-06 18:16                                   ` Ray Blaak
2007-03-06 23:49                                   ` Randy Brukardt
2007-03-07  8:59                                     ` Dmitry A. Kazakov
2007-03-07 18:26                                       ` Ray Blaak
2007-03-07 19:03                                         ` Dr. Adrian Wrigley
2007-03-07 19:55                                         ` Dmitry A. Kazakov
2007-03-07 20:17                                           ` Ray Blaak
2007-03-08 10:06                                             ` Dmitry A. Kazakov
2007-03-08 18:03                                               ` Ray Blaak
2007-03-07 20:18                                           ` Pascal Obry
2007-03-07 20:41                                             ` Dr. Adrian Wrigley
2007-03-08  5:45                                               ` Randy Brukardt
2007-03-08 10:06                                                 ` Dmitry A. Kazakov
2007-03-10  1:58                                                   ` Randy Brukardt
2007-03-10  9:11                                                     ` Dmitry A. Kazakov [this message]
2007-03-08 18:08                                                 ` Ray Blaak
2007-03-10  1:50                                                   ` Randy Brukardt
2007-03-05 15:23                   ` Embedded languages based on early Ada (from "Re: Preferred OS, processor family for running embedded Ada?") Colin Paul Gloster
2007-03-06  0:31                     ` Dr. Adrian Wrigley
2007-03-01 16:09                 ` Colin Paul Gloster
2007-03-01 13:23               ` Martin Thompson
2007-02-26 16:34           ` Preferred OS, processor family for running embedded Ada? Jean-Pierre Rosen
2007-02-26 21:18             ` Dr. Adrian Wrigley
2007-02-27 15:39               ` Jean-Pierre Rosen
2007-02-28 12:25                 ` Jerome Hugues
2007-02-24 19:11       ` Mike Silva
2007-02-24 13:59     ` Jacob Sparre Andersen
2007-03-01 19:32       ` Jacob Sparre Andersen
2007-03-01 20:22         ` Mike Silva
replies disabled

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