comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: tasks, simple question
Date: 1999/11/15
Date: 1999-11-15T00:00:00+00:00	[thread overview]
Message-ID: <3830c61c_3@news1.prserv.net> (raw)
In-Reply-To: 382FC705.29121528@interact.net.au

In article <382FC705.29121528@interact.net.au> , G 
<Dizzy@interact.net.au>  wrote:

> What I am wondering is where and when one would use them.
>
> What sort of role they play, so to say.  What sort of things one
> would use them for.

Tasks are used for implementing concurrent abstractions.


package Philosophers is

  type Philosopher_Type (Id : Positive) is limited private;

  <ops for philosophers>

private

  -- This handles the concurrency aspects of a philosopher
  -- abstraction.
  type Philosopher_Task_Type
    (Philosopher : access Philosopher_Type);

  type Philosopher_Type (Id : Positive) is
    limited record

      <other components, probably including a protected object>

      Philosopher_Task :
        Philosopher_Task_Type (Philosopher_Type'Access);

    end record;

end Philosophers;


Here, we have a group of philosophers who all eat and think
simultaneously.  An abstraction that is concurrent will have a component
implemented as a task.




--
If we let the Creationists have their way, we may as well go whole hog.
Let us reintroduce the flat-earth theory, the chemistry of the four
elements, and mediaeval astrology.  For these outworn doctrines have
just as much claim to rival current scientific views as Creationism does
to challenge evolutionary biology.

Abusing Science: The Case Against Creationism
Philip Kitcher




  parent reply	other threads:[~1999-11-15  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-15  0:00 tasks, simple question G
1999-11-15  0:00 ` DuckE
1999-11-15  0:00 ` Matthew Heaney [this message]
1999-11-15  0:00 ` tmoran
1999-11-15  0:00 ` Ehud Lamm
1999-11-16  0:00 ` tmoran
1999-11-16  0:00   ` Ted Dennison
1999-11-18  0:00 ` Riyaz Mansoor
replies disabled

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