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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5ee499d03212eed3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-07 21:23:38 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Dynamic dispatch again References: <3BC0FDB3.F185EDDF@san.rr.com> X-Newsreader: Tom's custom newsreader Message-ID: Date: Mon, 08 Oct 2001 04:23:38 GMT NNTP-Posting-Host: 24.7.82.199 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 1002515018 24.7.82.199 (Sun, 07 Oct 2001 21:23:38 PDT) NNTP-Posting-Date: Sun, 07 Oct 2001 21:23:38 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:13895 Date: 2001-10-08T04:23:38+00:00 List-Id: >Here, I only get to have one piece of code per >profile execute per message. I.e., now I only get one accept per unit. I >can't do something like >... >I instead have to store the state and wait passively for a call to be made. Huh? What's wrong with replacing the single changeable xlate with a bunch of changeable accept's and other calls, eg: package profile is type changeable_content is abstract tagged limited null record; type changeable_content_pointer is access all changeable_content'class; -- procedure xlate_content(what_to_do : in changeable_content; -- in_in : in integer; out_out : out integer) -- is abstract; procedure initialize_content(what_to_do : in changeable_content; params : in ...; ready : out boolean) is abstract; procedure connection_content(what_to_do : in changeable_content; params : ...) is abstract; procedure send_message_content(what_to_do : in changeable_content; ...) is abstract; procedure recv_message_content(what_to_do : in changeable_content; ...) is abstract; procedure stick_in_database_content(what_to_do : in changeable_content; ...) is abstract; task type general_task(content : changeable_content_pointer) is -- entry xlate(in_in : in integer; out_out : out integer); entry initialize(params : in ...; ready : out boolean); entry connection(params : ...); entry recv_message(...); end general_task; type general_task_pointer is access general_task; end profile; package body profile is task body general_task is begin -- loop -- select -- accept xlate(in_in : in integer; out_out : out integer) -- do -- xlate_content(content.all, in_in, out_out); -- end xlate; -- or -- terminate; -- end select; -- end loop; accept initialize(params : in ...; ready : out boolean) do initialize_content(content.all, params, ready); end accept; accept connection(params : ...) do -- set up connection connection_content(content.all, params); end accept; send_message(...); -- peer receiving open is first to send message send_message_content(content.all, ...); accept recv_message(...) do -- Process first answer recv_message_content(content.all, ...); end accept; stick_in_database(...); stick_in_database_content(content.all, ...); accept recv_message(...) do -- Process second answer recv_message_content(content.all, ...); end accept; ... end general_task; end profile;