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!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: tasks as part of record Date: Mon, 06 Oct 2014 10:18:07 +0300 Organization: Tidorum Ltd Message-ID: References: <294a973f-5222-4aa3-8971-777cd2eb9174@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: individual.net ti+1aljT2VIB0XDsAlyuLwd1o4A/swN9rSYiYzGhG8/4dyidty Cancel-Lock: sha1:Ts8D38kHxEb3nMvSAQKqnp5AO5A= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Xref: number.nntp.giganews.com comp.lang.ada:189428 Date: 2014-10-06T10:18:07+03:00 List-Id: On 14-10-06 06:47 , Stribor40 wrote: > I though it would be easier if task is componenet of record. *What* would be easier? Tasks are intended for a specific purpose, which is useful in *some* applications: to execute separate threads of control concurrently, and possibly in parallel if the computer has several processors. As I said before, it is unusual for an application to require a separate task for each data object (= student record), and such designs are usually complex and inefficient. > What i would like is that every time task runs By default, the conceptual model of Ada tasks is that any and all tasks can and do run at any time, concurrently and in parallel. If you want some coordination or synchronisation between tasks, you have to arrange for that. > i would like to operate on components of student record. > For example for each student there will be one tasks. Why? Why do you need concurrent / parallel execution of student operations? > When each tasks run i want it to identify yourself to the screen > with student number value. For example > > This is task #. -- where # is student number If you don't synchronise the tasks in some way, all tasks run concurrently, and your screen will be a mess of such messages, mixed and interleaved in any random order. Moreover, using Ada.Text_IO concurrently from several tasks on the same file object (such as Standard_Output) is illegal in principle, although it may more or less "work" in some environments. I suspect strongly that using tasks at all in your application is unnecessary, and only complicates the design, which is why I would like to understand why your application needs concurrency. By the way, you are posting on the USENET group comp.lang.ada, and most USENET clients do not show the context of a post automatically. Please quote, in each post, as much as necessary of the earlier post to which you are replying, and insert your answers below the sentences to which they apply. This will make it easier to communicate with you. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .