comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: tasks as part of record
Date: Mon, 06 Oct 2014 10:18:07 +0300
Date: 2014-10-06T10:18:07+03:00	[thread overview]
Message-ID: <c9eu13Fqo1jU1@mid.individual.net> (raw)
In-Reply-To: <c474fef2-701c-4968-94eb-aec57bee0dd3@googlegroups.com>

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
      .      @       .


  parent reply	other threads:[~2014-10-06  7:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-04 13:11 tasks as part of record Stribor40
2014-10-04 13:33 ` Simon Wright
2014-10-04 22:12 ` Stribor40
2014-10-05  7:36   ` Jacob Sparre Andersen
2014-10-05  8:11 ` Niklas Holsti
2014-10-06  3:47   ` Stribor40
2014-10-06  5:43     ` Jeffrey Carter
2014-10-06  7:18     ` Niklas Holsti [this message]
2014-10-06  8:00       ` Dmitry A. Kazakov
2014-10-06 11:40         ` G.B.
2014-10-06  8:06       ` Simon Wright
2014-10-06  8:24     ` Simon Wright
2014-10-12 22:33       ` compguy45
2014-10-13  7:32         ` Simon Wright
2014-10-13 14:45           ` compguy45
2014-10-13 15:33             ` Shark8
2014-10-18 18:21           ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox