comp.lang.ada
 help / color / mirror / Atom feed
From: "Ehud Lamm" <mslamm@mscc.huji.ac.il>
Subject: Re: Problem with tasks
Date: Thu, 26 Jul 2001 23:28:51 +0300
Date: 2001-07-26T23:28:51+03:00	[thread overview]
Message-ID: <9jpujh$158$1@news.huji.ac.il> (raw)
In-Reply-To: HbX77.7784$ar1.25497@www.newsranger.com


Ted Dennison <dennison@telepath.com> wrote in message
news:HbX77.7784$ar1.25497@www.newsranger.com...
> In article <3b5e887e.10671695@news.bt.es>, Carlos Aganzo says...
> >
> >I need to create a new instance of the same task from itself,
>
> First off, this sounds like you designed a system around the "fork"
concept, and
> are now trying to plug that into Ada. You'll have a lot easier time if you
> *design* from Ada too.

Maybe. But sometimes the design call for this type of behaviour, and it has
nothing to do with forking.

> If you want to dynamicly create tasks in Ada, you should be using task
types.
> You can create pointers to task type objects, put them in arrays,
dynamicly
> allocate and deallocate them, etc. You can even create them from within
> themselves, if you *truly* need something like "fork". That type of
activity can
> lead to "fork-bomb" errors though.
>

Right. That's why a good design would make use of a task-allocator
abstraction, which may allocate a new taks, but may later be changed to
manage a finite sized pool of tasks (the "thread pool" pattern).


Ehud Lamm





  reply	other threads:[~2001-07-26 20:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-25  8:52 Problem with tasks Carlos Aganzo
2001-07-25  9:32 ` Jean-Pierre Rosen
2001-07-26  1:47 ` DuckE
2001-07-26 11:20 ` Carlos Aganzo
2001-07-26 16:03 ` Ted Dennison
2001-07-26 20:28   ` Ehud Lamm [this message]
2001-07-27 12:42     ` Ehud Lamm
2001-07-27  8:15 ` Carlos Aganzo
  -- strict thread matches above, loose matches on Subject: below --
2004-09-04  8:57 Magik
2004-09-04 10:51 ` Frank J. Lhota
2004-09-04 11:02   ` Magik
2004-09-04 13:53 ` Pascal Obry
replies disabled

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