comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: Composing tasks and protected objects
Date: Sat, 06 Aug 2005 05:52:11 GMT
Date: 2005-08-06T05:52:11+00:00	[thread overview]
Message-ID: <feYIe.2038$WD.851@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <87iryk1eic.fsf@mid.deneb.enyo.de>

Florian Weimer wrote:
> 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.

You need all calls to go the same way. Right now you're trying to do 
something like

+----------+          +----------+          +----------+
|          |          |          |          |          |
|     Q    |<--Get----|  Server  |<--Shut---|     ?    |
|          |          |          |   Down   |          |
|          |          |          |<--Reload-|          |
|          |          |          |          |          |
+----------+          +----------+          +----------+

where arrows indicate direction of call. This won't work, but it will 
work if you can turn that call to Get around. For this, you need a 
forwarder between the Queue and Server:

+----------+       +----------+       +----------+       +----------+
|          |       |          |       |          |       |          |
|     Q    |<-Get--| Forwarder|--Msg->|  Server  |<-Etc--|     ?    |
|          |       |          |       |          |       |          |
+----------+       +----------+       +----------+       +----------+

Now your task can look like

select
    accept Msg (Message : in ...) do
       Current_Message := Message;
    end Msg;

    Process_Message (Current_Message);
or
    ... -- as in your example
end select;

The only difficulty is terminating the Forwarder.

-- 
Jeff Carter
"Go and boil your bottoms."
Monty Python & the Holy Grail
01



  parent reply	other threads:[~2005-08-06  5:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
replies disabled

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