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!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: confusion about message passing between the tasks Date: Fri, 24 Oct 2014 20:39:20 +0200 Organization: A noiseless patient Spider Message-ID: <87tx2te2hz.fsf@ludovic-brenta.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="f51eff624ce5a87c6ebf9332dd27f01f"; logging-data="14298"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Rg97l1FG7eiVay82uTTEn" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:LLYtMV76Kh5ZJcGaDJU3jrkAqbg= sha1:f3uSA1FLI0SQxcPilPg/S86xmjY= Xref: news.eternal-september.org comp.lang.ada:22707 Date: 2014-10-24T20:39:20+02:00 List-Id: compguy45@gmail.com writes: > I am really kind of lost with tasks and message passing. Would anyone > show me an example where 2 tasks would be created by environment > task...each task has same body and one entry...so for example one task > waits at entry while the other one completes the entry block and on > the exit lets waiting task that's its done. Maybe you'll be interested in the talk I gave at FOSDEM 2014; this was part two of "Multitasking made easy", subtitled "Ada Task Pools". Source code is available here: http://people.debian.org/~lbrenta/ada-fosdem2014.tar.gz and the one-hour video is here: http://video.fosdem.org/2014/K4601/Saturday/ In the example discussed, the main task starts N identical tasks and then calls an entry Start on each task. The number of tasks is computed at run time. -- Ludovic Brenta.