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: border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Problem with tutorial example Date: Mon, 22 Sep 2014 07:23:36 +0100 Organization: A noiseless patient Spider Message-ID: References: <19829aef-4baa-4d96-a205-7e72b8a6d9a8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="272a0c27c56b2c3b0dc8613c85258f4f"; logging-data="15772"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iLR1wRaBmQfTKHioIJ9gwJLQDyRjOsA4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:T3RWzQJwzu8kvQv7uA98tuIHS70= sha1:ioAb+sUxr3/kFx7QXQpfuA7wdJw= Xref: number.nntp.dca.giganews.com comp.lang.ada:189080 Date: 2014-09-22T07:23:36+01:00 List-Id: Stribor40 writes: > I am trying to study example i found in this page > http://infres.enst.fr/~pautet/Ada95/e_c26_p2.ada where first, second > and third tasks output lines of text to monitor but main task at the > end of the program never calls any of these tasks. Now i understand > that Ada uses linear declaration and that it loads each tasks and > makes each tasks wait at the "begin". So as lines are read each tasks > execuatable part is loaded but each tasks wait at begin. > Now main task doesnt call any of these other 3 tasks at all. All it > does is output line of text "i am main..." > Can someone point out how do these 3 tasks get fired up please? None of the tasks have anything to stop them running as soon as they are able to, so that's what they'll do. And the point at which they are able to start running is at the end of the declarative region in which they are declared .. which is the 'begin' of the main program. You could give them something that needs to be called using an entry .. task First_Task is entry Start; end First_Task; task body First_Task is begin accept Start; for Index in 1..4 loop Put("This is in First_Task, pass number "); and then something (the main program, probably) would have to call First_Task.Start before First_Task could proceed.