comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Re: Dynamic dispatch again
Date: Tue, 09 Oct 2001 15:40:19 GMT
Date: 2001-10-09T15:40:19+00:00	[thread overview]
Message-ID: <3BC31A54.F33F03D1@san.rr.com> (raw)
In-Reply-To: 6Nuw7.17802$IY3.12247494@news1.rdc1.sfba.home.com

tmoran@acm.org wrote:
> 
> >approach to dynamically dispatching an entry to one of N different tasks
>   If the bodies of the tasks are too heterogeneous, how about the calls
> on the tasks.  Are there a small number of subroutines A, B, and C that
> do all the calls?  Could you make an A that calls task One, and another
> A that is identical except that it replaces all references to One with
> references to Two, and so forth.  Then use overloading to tell which A
> is being used.  Or have a tagged type determine dynamically which A is
> to be used, and thus implicitly which task is to be called.

Basically, what it sounds like you're suggesting is that I wrap the
entry statements inside the polymorphic calls. That is, rather than

accept xxx(...) do
   t.xxx(...) -- polymorphic dispatch
end accept;

I think you're suggesting I do

  procedure t.xxx(...) is -- polymorphic dispatch with
    xxx(...) -- call the entry for this particular task
  end xxx;

I think that's what I'm going to wind up having to do. Basically, I was
trying to avoid having to say things like "this routine should not
block", but rather deal with it with event queuing, selective accept,
and so on. However, it looks like I'm going to have to build a tagged
type and rely on the programmer building in calls to entries or
instantiating queues and such as appropriate. I was hoping to put all
this infrastructure in the library so it would be easier to construct a
configuration. Le sigh. :-)

There are about 30 routines that need to be dynamically dispatched. In
addition to those 30 primitives, there are a number of primitives that I
would want to layer on top that I'd been hoping to build as tasks that
map the original primitives into the same set of primitives. For
example, a task that would receive each fragment of the message until
all fragments had arrived, concatenate them, and present them as if they
arrived in one chunk, or a task that would accept a message, blocking
the caller until it had actually been put on the wire, etc. I can
probably do these with protected objects or so, but again I expect I'll
wind up running into problems with specs and implementations tied too
tightly.

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
                   Who is this Dr. Ibid anyway, 
                  and how does he know so much?



  reply	other threads:[~2001-10-09 15:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-06  1:08 Dynamic dispatch again Darren New
2001-10-06 17:52 ` tmoran
2001-10-08  1:13   ` Darren New
2001-10-08  4:23     ` tmoran
2001-10-08 16:26       ` Darren New
2001-10-08 18:21         ` tmoran
2001-10-08 19:07           ` Darren New
2001-10-09  0:25             ` tmoran
2001-10-09  0:40               ` Darren New
2001-10-09  1:29                 ` Larry Hazel
2001-10-09  4:10                 ` tmoran
2001-10-09 15:40                   ` Darren New [this message]
2001-10-09 17:58                     ` tmoran
2001-10-09 19:26                       ` Darren New
2001-10-09 19:42                         ` tmoran
2001-10-09 20:23                           ` Darren New
2001-10-09 22:37                         ` tmoran
2001-10-10 18:17                           ` Darren New
replies disabled

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