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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada lacks lighterweight-than-task parallelism Date: Sun, 1 Jul 2018 11:46:34 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <993f28de-6a64-480b-9c6e-d9714bcdef0d@googlegroups.com> <167bec10-2a52-4c79-958d-91faadad915b@googlegroups.com> <2d6a5ab7-812f-47a9-a958-44177a3cf203@googlegroups.com> <64a526cb-e6d5-44a6-b446-5b652ebe60ca@googlegroups.com> <845ed7d6-f0c0-4c6e-834c-eea8f2ad1792@googlegroups.com> NNTP-Posting-Host: 3CrKQyqWAJZHy6zYVP/kUg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Content-Language: en-US X-Mozilla-News-Host: news://news.aioe.org X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader02.eternal-september.org comp.lang.ada:53488 Date: 2018-07-01T11:46:34+02:00 List-Id: 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