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 18:13:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!jfk3-feed1.news.digex.net!dca6-feed2.news.digex.net!intermedia!newsfeed1.cidera.com!Cidera!cyclone1.gnilink.net!news-east.rr.com!cyclone.kc.rr.com!news.kc.rr.com!news-west.rr.com!lsnws01.we.mediaone.net!typhoon.san.rr.com!not-for-mail Message-ID: <3BC0FDB3.F185EDDF@san.rr.com> From: Darren New Organization: Boxes! X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Dynamic dispatch again References: <3BBE5993.1CF0069D@san.rr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 08 Oct 2001 01:13:37 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: typhoon.san.rr.com 1002503617 66.75.151.160 (Sun, 07 Oct 2001 18:13:37 PDT) NNTP-Posting-Date: Sun, 07 Oct 2001 18:13:37 PDT Xref: archiver1.google.com comp.lang.ada:13887 Date: 2001-10-08T01:13:37+00:00 List-Id: tmoran@acm.org wrote: > > >OK, I'm still trying to figure out how to make one entry call wind up > >calling code in different units. > >... > >Essentially, I have a basic manager task doing I/O, distributing > >messages to "profiles". Each "profile" can get the same set of messages > >(start, stop, are you ready, here's a message), but each responds to the > >messages in different ways. > > How about having a single "profile" task, and using tagged type "methods" > to respond in different ways, eg: I thought about this. The problem is that profiles are basically implementing protocols. 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 begin accept initialize(params : in ...; ready : out boolean) do ... end accept; accept connection(params : ...) do -- set up connection end accept; send_message(...); -- peer receiving open is first to send message accept recv_message(...) do -- Process first answer end accept; stick_in_database(...); accept recv_message(...) do -- Process second answer end accept; ... end; I instead have to store the state and wait passively for a call to be made. At this point, I might as well use a protected object, since I still don't have a thread running in my code. It would be very difficult, for example, to have the "are you ready to start?" question answered "yes", followed immediately by starting to do something. On the other hand, if I could get different entries being invoked with a dynamic dispatch, something like the above would let me immediately start sending as soon as the remote side requested a connection, for example. It would also let me do something like "accept a message coming in and put it on the screen, or accept a line from the keyboard and send it over the socket." But if Ada can't do this, I'm going to have to come up with a different way of doing it which will be (I fear) far more painful and obtuse. I'm expecting I'll have to basically package up all the parameters and build queues of messages, and essentially reimplement all the entry queueing stuff myself. -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. Who is this Dr. Ibid anyway, and how does he know so much?