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 14:07:37 GMT
Date: 2007-03-03T14:07:37+00:00	[thread overview]
Message-ID: <pan.2007.03.03.14.08.34.569578@linuxchip.demon.co.uk.uk.uk> (raw)
In-Reply-To: q95ob4-082.ln1@rimmer.farnz.org.uk

On Sat, 03 Mar 2007 12:12:10 +0000, Simon Farnsworth wrote:

> Jonathan Bromley wrote:
> 
>> On Sat, 3 Mar 2007 12:00:08 +0100, "Dmitry A. Kazakov"
>> <mailbox@dmitry-kazakov.de> wrote:
>> 
>>>> 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
>> 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?
>> 
> Not disagreeing with most of what you're saying, but I do feel the need to
> point out the existence of systems with hotpluggable CPUs. Sun and IBM have
> both sold systems for some years where CPUs can be added and removed at
> runtime; software is expected to just cope with this.
> 
> Also in the software domain; there is a cost to switching between different
> threads. Thus, in software, the aim is to limit the number of runnable
> threads to the number of active CPUs. If there are more threads runnable
> than CPUs available, some CPU time is wasted switching between threads,
> which is normally undesirable behaviour.

This is part of the problem.  Parallelism has to be be *inhibited* by
explicit serialisation, to limit the number of threads created.

So a construct like (in Ada):

for I in Truth'Range loop
   Z := Z xor Truth (I);
end loop;

deliberately forces an execution serial order, even although we
know that order does not matter at all, in this case.

There is no effective consruct to permit but not require concurrency.

The software compiler can't sensibly parallelise this because:

The semantics of xor may be unknown (overloaded), and unsuitable
The execution time of each iteration is much smaller than thread
   start/stop time
Too many parallel threads would be created

So we're left with source code which implies a non-existent serialisation
constraint.

If the "for I in all..." construct were in the language, we'd be
able to say "I don't care about the order", and permitting concurrency,
even if the result weren't identical (eg when using floating point)

Numerous algorithms in simulation are "embarrassingly parallel",
but this fact is completely and deliberately obscured from compilers.
Compilers can't normally generated fine-scale threaded code because
the applications don't specify it, the languages don't support it,
and the processors don't need it.  But the technical opportunity
is real.  It won't happen until the deadlock between compilers, software
and processors is broken.
--
Adrian




  reply	other threads:[~2007-03-03 14:07 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 [this message]
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
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