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!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Feature suggestion: different task schedules Date: Fri, 14 Jul 2017 10:37:50 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1500011977.2481.9.camel@obry.net> NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.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 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:47412 Date: 2017-07-14T10:37:50+02:00 List-Id: On 14/07/2017 07:59, Pascal Obry wrote: >> pragma Schedule=>Manual; >> >> the task runs only when a protected entry is called and stops at the >> next accept statement. >> >> This is usually the fastest mode in the case of one-core system. > > I don't see the point. Call from the task the PO with a barrier. The > task will be sleeping until waken-up by an event on this PO. Isn't this > is exactly what you looking for? The point, I presume, is to have co-routines. For that purpose the object used to yield processor is not even protected. All parties are synchronized already. As a use-case consider a producer-consumer pair. Both would be pseudo-tasks backed by single thread of control (proper task). > Don't assume you have to do optimization yourself. Most of the time the > compiler and runtime does this for you and using the most efficient > syscall on the target. This is not the case for co-routines where transition of control is virtual, only there to use a task abstraction for decomposition of an algorithm that itself is strictly non-concurrent. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de