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!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: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Concurrency in Ada Date: Sun, 07 Sep 2014 11:06:44 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <4d9466ad-5c9e-4b1f-8797-def623b3beb6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 7 Sep 2014 18:06:46 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="5b4eadb0ecf28f7f740a0e18f3715b8f"; logging-data="30348"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jGZJq7YywO3rRRljvW6uIVnXjus701JE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 In-Reply-To: <4d9466ad-5c9e-4b1f-8797-def623b3beb6@googlegroups.com> Cancel-Lock: sha1:5bVpiz6/6ap/s7Tc7jsUUdQkddA= Xref: number.nntp.dca.giganews.com comp.lang.ada:188909 Date: 2014-09-07T11:06:44-07:00 List-Id: On 09/07/2014 05:29 AM, Stribor40 wrote: > I have this program from online tutorial that says that tasks will run as > soon as program starts. My question is when does this program starts on what > line if code I'm not sure what you're asking. In Ada the declarations (before "begin") are elaborated at run time, followed by execution of the statements after "begin". Task objects such as in the example begin executing when elaboration/execution reaches "begin". > Do tasks run all at same tine or they are scheduled by OS which would mean > anytime you run this program output would be different? Conceptually, tasks run at the same time. What actually happens depends on the OS (if any) and number of processors available. In general, the externally observable effects of multiple tasks will differ from run to run unless the program takes steps to ensure otherwise. See a recent thread here on c.l.a on interleaved output from tasks. -- Jeff Carter "It's symbolic of his struggle against reality." Monty Python's Life of Brian 78