comp.lang.ada
 help / color / mirror / Atom feed
* Multiple task bodies for one task type?
@ 2001-09-15  0:26 Darren New
  2001-09-17  9:37 ` John McCabe
  2001-09-17 14:15 ` Stephen Leake
  0 siblings, 2 replies; 7+ messages in thread
From: Darren New @ 2001-09-15  0:26 UTC (permalink / raw)


What's the normal Ada idiom for having multiple types of task in an
array?

Basically, I want a bunch of tasks where I can do something like

tat : array (1..10) of mumble;
ta : tat;
begin
  -- "perform" is an entry or a protected procedure
  ta(1).perform(30);
  ta(2).perform(30);
end

and have the two calls execute different code.

Generally, I want to write a framework where these tasks act something
like callbacks, except I expect I'm going to want them to actually be
tasks and protected objects (probably one of each).

But it looks like each task type gets exactly one task body.

Of course, the primary problem is that things like "accept" and "abort"
and such have to actually be in the task body itself, not in subprograms
called from the task body, or I'd just make (say) a generic with a
procedure for each entry, or something.

Any hints how one would go about this? Thanks in advance!

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
    Those who work hard with few results always 
           value hard work over getting results.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-09-18 21:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-15  0:26 Multiple task bodies for one task type? Darren New
2001-09-17  9:37 ` John McCabe
2001-09-17 14:01   ` Tucker Taft
2001-09-18 19:01   ` Richard Riehle
2001-09-18 21:03     ` Darren New
2001-09-18 21:26     ` tmoran
2001-09-17 14:15 ` Stephen Leake

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