comp.lang.ada
 help / color / mirror / Atom feed
* Deallocating records with task type fields.
@ 2005-12-09 22:49 Gene
  2005-12-10  7:16 ` Jeffrey R. Carter
  2005-12-10 14:10 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 11+ messages in thread
From: Gene @ 2005-12-09 22:49 UTC (permalink / raw)


Please consider these declarations for a task with some task local
data:

   type Listener_Type;

   task type Listener_Task_Type(Env : access Listener_Type);

   type Listener_Type is
      record
         Port : Positive;
         Executive : Listener_Task_Type(Listener_Type'Access);
      end record;

With this, the executive task has access to the task local environment
exemplified here by a port number.

Here are the questions:

1.  Is this a good idiom for implementing task local data, or is there
some other preferable method?
2.  As I read the ALRM it is incorrect to deallocate a Listener_Type
object until the Executive task has exited.  What is a good idiomatic
way for the Executive to deallocate its own task local storage just
before it exits and without causing a race condition?  [The only ways I
can come up with seem like excessive machinery.]

Thanks in advance.




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

end of thread, other threads:[~2005-12-13 10:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-09 22:49 Deallocating records with task type fields Gene
2005-12-10  7:16 ` Jeffrey R. Carter
2005-12-10 11:45   ` Simon Wright
2005-12-10 14:10 ` Dmitry A. Kazakov
2005-12-11  4:06   ` Gene
2005-12-11 11:50     ` Dmitry A. Kazakov
2005-12-12 11:32       ` Alex R. Mosteo
2005-12-12 18:30         ` Pascal Obry
2005-12-13 10:22           ` Alex R. Mosteo
2005-12-12 22:03     ` Randy Brukardt
2005-12-11  5:02   ` Gene

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