comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Multiple task bodies for one task type?
Date: Sat, 15 Sep 2001 00:26:01 GMT
Date: 2001-09-15T00:26:01+00:00	[thread overview]
Message-ID: <3BA2A012.1C2A2903@san.rr.com> (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.



             reply	other threads:[~2001-09-15  0:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-15  0:26 Darren New [this message]
2001-09-17  9:37 ` Multiple task bodies for one task type? 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
replies disabled

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