comp.lang.ada
 help / color / mirror / Atom feed
* Composing tasks and protected objects
@ 2005-08-05 17:26 Florian Weimer
  2005-08-05 17:49 ` Robert A Duff
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Florian Weimer @ 2005-08-05 17:26 UTC (permalink / raw)


Suppose I want to write a selective accept which reads messages from a
queue, and also support a special entry call to reload the
configuration.

Conceptually, this would look like this:

   task Server is
      entry Reload_Configuration (Config : Config_Template);
      entry Shut_DOwn;
   end Server;

   task body Server is
      Current_Message : Message;

   begin
      loop
         select
            Get (Queue, Current_Message);
            Process_Message (Current_Message);

         or
            accept Reload_Configuration (Config : Config_Template) do
               Process_Reload (Config);
            end Reload_Configuration;

         or
            accept Shut_Down;
            exit;       -- Premature shut down requested

         or
            terminate;  -- Normal shutdown at end of scope
         end select;
      end loop;
   end Server;

In short, I want to perform protected entry calls and selective accept
in parallel.

Is this possible at all, without writing lots of stupid wrappers?  If
not, what was the justification for not integrating the two language
features (protected objects/tasks) in this way?



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

end of thread, other threads:[~2005-08-08 22:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-05 17:26 Composing tasks and protected objects Florian Weimer
2005-08-05 17:49 ` Robert A Duff
2005-08-05 18:09   ` Florian Weimer
2005-08-05 18:26     ` Robert A Duff
2005-08-05 19:20       ` Florian Weimer
2005-08-07  1:27       ` Randy Brukardt
2005-08-08 21:55         ` Robert A Duff
2005-08-06  5:52 ` Jeffrey Carter
2005-08-08  9:52   ` Florian Weimer
2005-08-08 20:50     ` Randy Brukardt
2005-08-08 22:14       ` Robert A Duff
2005-08-06  9:01 ` Dmitry A. Kazakov

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