From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,97f543c7a63b8839,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!feed.news.tiscali.de!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Composing tasks and protected objects Date: Fri, 05 Aug 2005 19:26:35 +0200 Message-ID: <87iryk1eic.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: albireo.enyo.de 1123262810 30676 212.9.189.177 (5 Aug 2005 17:26:50 GMT) X-Complaints-To: Cancel-Lock: sha1:2vaghZFlSW/lEc8RVgIlyYEv92A= Xref: g2news1.google.com comp.lang.ada:3986 Date: 2005-08-05T19:26:35+02:00 List-Id: 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?