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!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: RFC: Prototype for a user threading library in Ada Date: Sun, 3 Jul 2016 10:39:31 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <58b78af5-28d8-4029-8804-598b2b63013c@googlegroups.com> <1e32c714-34cf-4828-81fc-6b7fd77e4532@googlegroups.com> <2598edcf-b0fd-4ceb-b1c4-8930371dd3cb@googlegroups.com> NNTP-Posting-Host: w/2xSGckQeJEFvqsQFNodA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:31013 Date: 2016-07-03T10:39:31+02:00 List-Id: On 2016-07-03 09:42, Hadrien Grasland wrote: > Le samedi 2 juillet 2016 23:14:30 UTC+2, Niklas Holsti a écrit : >> Moreover, in present Ada it seems to me that the only way to move >> task-private data from one task to another is to send a copy of the data >> from one task to the other. Copying data is often poison for performance. > > Cheaply moving data around is possible in any language that has heap > allocation and pointers. That is the most expensive way doing it, and on top of that, it requires shared memory (pool) and thus process-global interlocking. You arrived at the starting point. BTW, when talking about asynchronous model, marshaling must be asynchronous too. Another drawback of the method of doing that through pointers is that it must be atomic = synchronous => you could not deal with large objects, on-demand production models etc. And this is where event-controlled model stop working, as it separates data from data-related events. A proper abstraction must combine everything into ADT objects. > What is more difficult is to provide an easy to > use syntax around it. Hmm, what is difficult about procedure call? >> Perhaps a new, restricted tasking profile would be needed, analogous to >> the Ravenscar profile but aimed not at real-time systems but at parallel >> computation in this event-based style. > > It is true that for computation purposes, the full Ada tasking model > may also be overkill. For example, asynchronous transfer of control can > be hard to support, and is often overkill for compute scenarios. Well, actually ATC is totally useless for parallel computing because it simply does not work when you wanted to abort an external blocking operation. There is a similarity between the ATC and co-routines. ATC does not work because the OS is not aware of ATC requests. It is exactly same as if a co-routine would perform asynchronous I/O. OS does not know how to continue it. My wild guess is that an Ada RTS capable to handle co-routines will easily handle ATC as a by product, and conversely. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de