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!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Feature suggestion: different task schedules Date: Mon, 24 Jul 2017 17:26:38 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 24 Jul 2017 15:22:39 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="22ee90f4578fc4463ed10eb9e89eb06f"; logging-data="4456"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18TYKuNSq0+dZOOueGiULuK" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:6tb3pm1q8q0WcgyxBniKVPRQrDc= Xref: news.eternal-september.org comp.lang.ada:47504 Date: 2017-07-24T17:26:38+02:00 List-Id: On 23/07/17 14:31, Victor Porton wrote: > Dmitry A. Kazakov wrote: > >> On 18/07/2017 22:09, Randy Brukardt wrote: >>> "Dmitry A. Kazakov" wrote in message >>> news:okkcgc$1m31$1@gioia.aioe.org... >>>> On 18/07/2017 02:09, Randy Brukardt wrote: >>> ... >>>>> And most important of all -- what problem >>>>> needs to be solved. >>>> >>>> A co-routine with task interface lacking task overhead. >>> >>> I hate to sound like a broken record, but that's a solution, not a >>> problem. One would need to explain what problem(s) can't be reasonably >>> solved with the existing features of Ada that could be solved with a >>> co-routine. (And a purely performance argument is by far the weakest >>> IMHO; very few programs are really performance bound, and most of those >>> would value more tasking.) >> >> It is not performance argument. It is it the first line design argument >> (control flow inversion) as I explained in another post. >> >> I admit that I don't understand the OP proposal. It is not sufficiently >> described and scheduling is not single issue here. Not in the cases I >> have in mind. >> >> A task based solution is non-starter for two reasons. >> >> One is that it is not composable. I expect a co-routine proposal to >> offer a possibility to implement stacked layered protocols. I don't see >> how that would be possible on task basis. A protocol implementation may >> not be a task object. > > I don't understand why it is not composable. A task may call another tasks. > Tasks may even call each others in a cycle. > > However I think, we may have some sort of problem about specifying something > in hypothetical Ada2020 what is similar to `yield from` in Python. It seems > that for this we need to introduce something like "multi" accept statement, > but I did not yet thought about this. I'm not sure if this has been discussed here or if it is even the same feature as in Python, but there is an AI proposal for generator functions using "yield": http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0197-1.txt?rev=1.7&raw=N Álex. > >> Another reason is design and OS constraints. Protocols must be handled >> by worker tasks. Number of tasks <<< number of connections, e.g. number >> of sockets. >