comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada lacks lighterweight-than-task parallelism
Date: Sun, 1 Jul 2018 11:46:34 +0200
Date: 2018-07-01T11:46:34+02:00	[thread overview]
Message-ID: <pha7tr$1hc5$1@gioia.aioe.org> (raw)
In-Reply-To: 845ed7d6-f0c0-4c6e-834c-eea8f2ad1792@googlegroups.com

On 2018-06-30 17:43, Brad Moore wrote:
> I don't think that would fit into the language very well, and I dont think this is particularly appealing to me, though at one time I was suggesting that we could apply aspects such as parallel and other controls to a locally declared subtype, we moved away from that idea. We have "reverse" syntax for loops already which specifies an order. It would be inconsistent to sometimes specify the order on the loop, and sometimes somewhere else.

I would say that semantically "reverse" applies to a set (range is a 
set) rather than to the loop. If sets were first-class:

    for I in reverse (Ordered_Set) loop

> It also seems like it would be messy for ADT's such as containers. Sometimes you want to iterate through a type sequentially, for example when the work to be performed per iteration is very small and not worth doing in parallel, and sometimes you want to specify parallel execution, if you know that there is significant processing required for each iteration. You might have a container with many elements. It sounds like you'd have to declare two container objects, (one parallel, and one sequential), and then copy all the elements from one to the other whenever you wanted to switch from sequential to parallel iteration or vice versa, when really you only want or need a single container object.

I would declare different enumerators for the container. It is a good 
practice to be able to enumerate a container by a key or by position or 
by something else (e.g. by code points for strings).

> Similarly, you might want to iterate through an enumeration with a particular order for one loop, and a different order for another loop. It seems to be better to apply the hint to the loop construct rather than the iterator type, which is also consistent with other approaches such as in OpenMP and Cilk.

To me that is still a property of the enumerated object rather than of 
the loop. Otherwise you must hard-wire implementation into the loop 
instead of the set/index/mapping type. It is container's business, IMO.

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


  reply	other threads:[~2018-07-01  9:46 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 22:14 Ada lacks lighterweight-than-task parallelism Dan'l Miller
2018-06-19 22:23 ` Dan'l Miller
2018-06-20  0:03 ` Dan'l Miller
2018-06-20  0:41 ` Lucretia
2018-06-20  1:36   ` Dan'l Miller
2018-06-20 13:39     ` Luke A. Guest
2018-06-20  1:12 ` Shark8
2018-06-20  1:41   ` Dan'l Miller
2018-06-20  7:13     ` Dmitry A. Kazakov
2018-06-20 12:03       ` Dan'l Miller
2018-06-20 12:29         ` Dmitry A. Kazakov
2018-06-20 13:14           ` Mehdi Saada
2018-06-20 13:38             ` Dmitry A. Kazakov
2018-06-20 14:01               ` Mehdi Saada
2018-06-20 14:32                 ` Dmitry A. Kazakov
2018-06-29 22:01                   ` Randy Brukardt
2018-06-29 22:15                     ` Dmitry A. Kazakov
2018-06-29 22:47                       ` Randy Brukardt
2018-06-30  8:41                         ` Dmitry A. Kazakov
2018-06-30 15:43                           ` Brad Moore
2018-07-01  9:46                             ` Dmitry A. Kazakov [this message]
2018-07-02 13:13                               ` Marius Amado-Alves
2018-07-02 15:05                                 ` Dmitry A. Kazakov
2018-07-02 16:01                                   ` Marius Amado-Alves
2018-07-02 16:48                                     ` Dmitry A. Kazakov
2018-06-20 15:58                 ` Niklas Holsti
2018-06-29 21:58                 ` Randy Brukardt
2018-06-21  0:19               ` Shark8
2018-06-21  9:09                 ` Dmitry A. Kazakov
2018-06-21 14:42                   ` Shark8
2018-06-21 15:55                     ` Dan'l Miller
2018-06-27 11:49                       ` Marius Amado-Alves
2018-06-21 16:06                     ` Dmitry A. Kazakov
2018-06-22 17:06                       ` Shark8
2018-06-22 18:53                         ` Dmitry A. Kazakov
2018-06-21  0:17         ` Shark8
2018-06-20 12:28 ` Brian Drummond
2018-06-21  1:51   ` Dan'l Miller
2018-06-21 10:22     ` Brian Drummond
replies disabled

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