comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Icon Co-Expressions in Ada
Date: 1998/12/16
Date: 1998-12-16T00:00:00+00:00	[thread overview]
Message-ID: <759856$54b$1@nnrp1.dejanews.com> (raw)
In-Reply-To: Pine.A41.3.96-heb-2.07.981216194156.29486C-100000@pluto.mscc.huji.ac.il

In article
<Pine.A41.3.96-heb-2.07.981216194156.29486C-100000@pluto.mscc.huji.ac.il>,
  Ehud Lamm <mslamm@mscc.huji.ac.il> wrote:

> user use tasks. It is sad, since as far as I know you can't simply make an
> Ada procedure behave in a task like way, by invking other procedures. The
> task must be explicit.

If we are talking Ada 95, there actually are (at least) *two* to do this.
Either way you start with a task type, and a manager or registrar package.
Each routine you want to "task-ize" must register with the manager. When a
procedure registers, it provides a subprogram with a standard interface(or
multiple ones). The registrar creates a task object and gives it the
subprogram to call. So far this is your standard C GUI-style "callback"
interface.

Now you just need to specify the procedure(s). One method is to define a
subprogram access type. But the method we have used here is to define an
abstract subprogram as an interface, and have the registrar pass a
(classwide) pointer to the tagged object to the newly-created task. To use
this system, the user just has to derive a type from the abstract class, and
put his Ada procedure code in the override of the abstract method. As soon as
he calls the registrar, his procedure will start getting called from its very
own task automagicly!

--
T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1998-12-16  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-16  0:00 Icon Co-Expressions in Ada Ehud Lamm
1998-12-16  0:00 ` dennison [this message]
1998-12-16  0:00 ` Stephen Leake
1998-12-16  0:00   ` Al Christians
1998-12-17  0:00   ` Mats Weber
1998-12-17  0:00     ` Ehud Lamm
1998-12-17  0:00   ` Ehud Lamm
1998-12-17  0:00     ` Mats Weber
1998-12-17  0:00       ` Chris Morgan
1998-12-17  0:00       ` Ehud Lamm
1998-12-17  0:00     ` Stephen Leake
1998-12-17  0:00       ` Ehud Lamm
replies disabled

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