comp.lang.ada
 help / color / mirror / Atom feed
From: peirce@claris.com (Michael Peirce)
Subject: Re: Two questions
Date: 29 Mar 89 18:35:57 GMT	[thread overview]
Message-ID: <9274@claris.com> (raw)
In-Reply-To: 674@uva.UUCP

>2. When a task has completed its execution, termination is delayed until all
>   dependent tasks have terminated (9.4.6).  As a result, our program
>   fills up all memory with completed tasks unable to terminate.  Why is
>   this?  Can something be done about it (without altering task dependency)?
>
>
>We have the impression that Ada was designed to deal with a small
>number of large tasks, whereas we are trying to create a large number
>of small tasks.  Is this true?  Does it matter?
>

The way we dealt with this problem was to reuse our tasks.  We had
a situation where we wanted to dispatch a handler task for each incoming
request from the network. In Vax Ada, the tasks weren't removed from
memory until after the program exited the scope of the task declaration.
This meant that in our outter most scope, a terminated tasks' memory
was never reclaimed.  To solve this problem, we set up a task manager that 
kept a list of idle tasks and whenever a task was requested it would reuse 
one of these tasks first before creating a new one.  Of course, each task
ended up having some extra code at the beginning to handle initialization
and some at the end to handle returning itself to the free list.  This
overhead was minimal though.

With this type of scheme in place we were able to run our system for 
days or weeks at a time using "new" tasks for each message, but never
running into memory usage problems.  

-- michael

  reply	other threads:[~1989-03-29 18:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-03-29  9:16 Two questions HansM
1989-03-29 18:35 ` Michael Peirce [this message]
1989-03-31 13:10 ` stt
1989-03-31 18:59 ` Scott Simpson
1989-04-03 14:44 ` callen
  -- strict thread matches above, loose matches on Subject: below --
1989-03-30 11:53 Piercarlo Grandi
1989-04-13  0:46 ` Paul Stachour
1989-04-11 13:32 Piercarlo Grandi
1989-04-14 17:14 ` callen
1996-05-01  0:00 Bernard Banner
1996-05-01  0:00 Ed Seidewitz
1996-05-01  0:00 W. Wesley Groleau (Wes)
1996-11-07  0:00 Ding-yuan Sheu
1996-11-07  0:00 ` Robert Dewar
1996-11-08  0:00 ` Robert I. Eachus
1996-11-08  0:00 ` Jon S Anthony
1996-11-08  0:00 ` Norman H. Cohen
1996-11-09  0:00 tmoran
1996-11-11  0:00 ` Adam Beneschan
1996-11-13  0:00 ` Richard A. O'Keefe
2001-03-09 18:27 chris.danx
2001-03-09 20:22 ` Mark Lundquist
2001-03-09 20:56 ` Randy Brukardt
2001-03-12 15:36 ` John English
2001-03-12 18:11   ` chris.danx
2001-03-12 10:59 Christoph Grein
2001-03-12 17:43 ` Stephen Leake
2002-07-04 22:25 Mark
2002-07-04 22:40 ` Jeffrey Creem
replies disabled

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