comp.lang.ada
 help / color / mirror / Atom feed
From: Leif Holmgren <nobody@nowhere.com>
Subject: Re: Ada tasking question
Date: Wed, 18 Apr 2007 23:08:51 +0200
Date: 2007-04-18T23:08:51+02:00	[thread overview]
Message-ID: <462688E3.6050105@nowhere.com> (raw)
In-Reply-To: f05okq$bt8$1@jacob-sparre.dk


Randy Brukardt wrote:
> "Stefan Bellon" <sbellon@sbellon.de> wrote in message
>>
>>Starting N tasks, then waiting for them to get all finished and only
>>then starting the next N tasks is not difficult.
...

> and an array of worker
> tasks, and then you can easy vary N to any value you want to try.

If my memory does not fail me the advice to use an array here is double 
good.

First of all you don't need to bother with the nitty gritty details of 
dynamic allocation yourself.

Secondly and perhaps most important Ada will handle the synchronization 
of task termination for you automatically. It will not allow the array 
to go out of scope before all the tasks are completed.

Years ago I implemented such a system (using dynamically allocated 
tasks) and it worked very well. By doing as suggested you will gain 
maximum performance even if the buckets take different time to process.

/Leif




  parent reply	other threads:[~2007-04-18 21:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-18 18:13 Ada tasking question Stefan Bellon
2007-04-18 18:40 ` Randy Brukardt
2007-04-18 20:12   ` Jeffrey R. Carter
2007-04-18 22:43     ` Stefan Bellon
2007-04-19  2:02       ` Steve
2007-04-18 21:08   ` Leif Holmgren [this message]
2007-04-18 22:57     ` Stefan Bellon
2007-04-18 23:41       ` Brian May
2007-04-19  0:25       ` Randy Brukardt
2007-04-19  8:02         ` Stefan Bellon
2007-04-19 12:47         ` Jacob Sparre Andersen
2007-04-19 16:11           ` Anh Vo
2007-04-20  4:32           ` Jeffrey R. Carter
2007-04-19  0:50       ` Jeffrey R. Carter
2007-04-18 19:50 ` Alex R. Mosteo
2007-04-18 23:00   ` Stefan Bellon
2007-04-19 20:37   ` Pascal Obry
2007-04-19  2:13 ` jimmaureenrogers
2007-04-19  7:49 ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
1996-10-18  0:00 whiting_ms@corning.com (Matt Whiting)
replies disabled

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