comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk>
Subject: Re: Embedded languages based on early Ada (from "Re: Preferred OS, processor family for running embedded Ada?")
Date: Sat, 03 Mar 2007 13:40:16 GMT
Date: 2007-03-03T13:40:16+00:00	[thread overview]
Message-ID: <pan.2007.03.03.13.41.27.542288@linuxchip.demon.co.uk.uk.uk> (raw)
In-Reply-To: camiu2tgii5qvtscjnl84kgr5d8hunu0ej@4ax.com

On Sat, 03 Mar 2007 11:27:50 +0000, Jonathan Bromley wrote:

> On Sat, 3 Mar 2007 12:00:08 +0100, "Dmitry A. Kazakov"
> <mailbox@dmitry-kazakov.de> wrote:
> 
>>Because tasks additionally have safe synchronization and data exchange
>>mechanisms, while PAR should rely on inherently unsafe memory sharing.
> 
> The PAR that I'm familiar with (from CSP/occam) most certainly does
> *not* have "inherently unsafe memory sharing".  There seems to be
> an absurd amount of wheel-reinvention going on in this thread.

I think reinvention is necessary.  Whatever "par" semantics was
in Occam is not available in Ada (or C, C++, Perl or whatever).
It was considered useful then - bring it back!

>>> The semantics I want permit serial execution in any order.  And permit
>>> operation even with a very large number of parallel statements in
>>> effect.  Imagine a recursive call with each level having many parallel
>>> statements.  Creating a task for each directly would probably break.
>>> Something like an FFT, for example.  FFT the upper and lower halves
>>> of Thing in parallel.  Combine serially.
>>
>>Yes, and the run-time could assign the worker tasks from some pool of,
>>fully transparently to the program. That would be very cool.
> 
> And easy to do, and done many times before.

How do you do this in Ada?  Or VHDL?  It's been done many times
before, yes, but not delivered in any currently usable form for
the general programmer :(  It's not in any mainstream language I know.

>>> The compiler should be able to generate code which generates a
>>> reasonable number of threads, depending on the hardware being used.
>>
>>Yes
> 
> For heaven's sake...   You have a statically-determinable number of
> processors.  It's your (or your compiler's) choice whether each of
> those processors runs a single thread, or somehow runs multiple
> threads.   If each processor is entitled to run multiple threads, then
> there's no reason why the number and structure of cooperating
> threads should not be dynamically variable.  If you choose to run
> one thread on each processor, your thread structure is similarly

Of course.  But how do I make this choice with the OSs and languages
of today?  "nice" doesn't seem to be able to be able to control
this when code is written in Ada or VHDL.  Nor is it defined
anywhere in the source code.

> static.  Hardware people have been obliged to think about this
> kind of thing for decades.  Software people seem to have a 
> pretty good grip on it too, if the textbooks and papers I've read
> are anything to go by.  Why is it suddenly such a big deal?

It's been a big deal for a long time as far as I'm concerned.
It's not a matter of "invention" mostly, but one of availability
and standards.  There is no means in Ada to say "run this in
a separate task, if appropriate".  Only a few, academic
and experimental tools offer the flexibility.  Papers /= practise.

>>> Maybe you're right.  But I can't see how to glue this in with
>>> Ada (or VHDL) semantics.
> 
> In VHDL, a process represents a single statically-constructed
> thread.  It talks to its peers in an inherently safe way through
> signals.  With this mechanism, together with dynamic memory
> allocation, you can easily fake-up whatever threading regime
> takes your fancy.  You probably wouldn't bother because
> there are more convenient tools to do such things in software
> land, but it can be done.

I'm not sure what you're talking about here.  Do you mean like any/all of
Split-C, Cilk, C*, ZPL, HPF, F, data-parallel C, MPI-1, MPI-2, OpenMP,
ViVA, MOSIX, PVM, SVM, Paderborn BSP, Oxford BSP toolset and IBM's TSpaces?

Specifying and using fine-grain parallelism requires language,
compiler and hardware support, I think.

Consider:
   begin par
      x := sin(theta);
      y := cos(theta);
   end par;

you probably *do* want to create a new thread, if thread creation
and destruction is much faster than the function calls.  You don't
know this at compile-time, because this depends on the library in use,
and the actual parameters.  Maybe X, Y are of dynamically allocated
length (multi-precision).

You can't justify designing hardware with very short thread
creation/destruction times, unless the software can be written
to take advantage.  But none of the mainstream languages
allow fine grain reordering and concurrency to be specified.
That's the Catch-22 that Inmos/Occam solved.  Technically.

The need is emerging again, now more threads on a chip
is easier than higher sequential instruction rate. 

>  In hardware you can do exactly the
> same thing, but one (or more) of your processes must then 
> take responsibility for emulating the dynamic memory allocation,
> carving up some real static physical memory according to 
> whatever strategy you choose to implement.
> 
>>That is the most difficult part! (:-))
> 
> Maybe.  But then again, maybe organising the structure of
> the actual application is the most difficult part, and this

This is sometimes true.

> vapid rambling about things that are already well-understood
> is actually rather straightforward.

Somewhere our models don't mesh.  What is "straightforward" to
you is "impossible" for me.  What syntax do I use, and which
compiler, OS and processor do I need to specify and exploit
fine-grain concurrency?

In 1987, the answers were "par", Occam, Transputer. Twenty
years later, Ada (or VHDL, C++, C#), Linux (or Windows), Niagara
(or Tukwila, XinC, ClearSpeed, Cell) do not offer us anything
remotely similar.  In fact, in twenty years, things have
got worse :(
--
Adrian





  parent reply	other threads:[~2007-03-03 13:40 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 [this message]
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
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