comp.lang.ada
 help / color / mirror / Atom feed
* deallocation tasks
@ 2000-05-03  0:00 Alfred Hilscher
  2000-05-03  0:00 ` Robert A Duff
  0 siblings, 1 reply; 5+ messages in thread
From: Alfred Hilscher @ 2000-05-03  0:00 UTC (permalink / raw)


Hi,

does anyone have a proposal for the following problem ?

What I want do is this: I have a loop that reads input and processes it.
If the input is something that would require long runtime, I want create
a new task so that it can run in background. But if the task terminates
I think I should free the (heap) memory.

My code would look someting like this:

task type t is ...

type a_t  is access t;
 
n_t : a_t;
...

loop
 -- get input

  if  -- input requires less time
  then
    -- consume it
  else -- input requires much time, start background task
    n_t := new a_t(input);  -- memory allocated here should be
deallocated after task termination
  end if;
end loop;


Any suggestions how to 'DEALLOCATE' the memory ? There can be more than
one task at a time. Any other ideas ?




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-05-05  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-03  0:00 deallocation tasks Alfred Hilscher
2000-05-03  0:00 ` Robert A Duff
2000-05-04  0:00   ` Pascal Obry
2000-05-04  0:00     ` Robert A Duff
2000-05-05  0:00       ` Alfred Hilscher

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