comp.lang.ada
 help / color / mirror / Atom feed
From: "chris.danx" <spamoff.danx@ntlworld.com>
Subject: Re: multitasking: finishing execution
Date: Thu, 20 Jun 2002 20:30:46 +0100
Date: 2002-06-20T20:30:46+01:00	[thread overview]
Message-ID: <64qQ8.9894$ZP1.1899365@news11-gui.server.ntli.net> (raw)
In-Reply-To: usn3it31c.fsf@gsfc.nasa.gov


"Stephen Leake" <stephen.a.leake.1@gsfc.nasa.gov> wrote in message
news:usn3it31c.fsf@gsfc.nasa.gov...


> The "Ada way" to terminate a task is with a "terminate" alternative:

Yep except that task will only respond to entries.  The problem requires
that it do useful work until it is quit.  That is, the task must execute a
sequence of events repeatedly and not in response to entries, but quit when
asked to.

> select
>    accept <some entry>
> or
>    terminate;
> end select;

That forbids the use of the else block (and a delay which is currently in
charge of executing the real work the task must do.  See the ARM section
9.7.1 points 8 through 12.

> See ARM 9.7.2.

Not ARM 9.7.1 and 9.3?  9.7.2 deals with timed entries.

> It is often not obvious how to set up your task to both get some work
> done and be ready to quit when told to. But it is important to get it
> right :).

Of course :)


Chris





  reply	other threads:[~2002-06-20 19:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-20  9:57 multitasking: finishing execution chris.danx
2002-06-20 12:48 ` Nige
2002-06-20 16:19   ` chris.danx
2002-06-20 20:40     ` Stephen Leake
2002-06-20 14:53 ` Stephen Leake
2002-06-20 19:30   ` chris.danx [this message]
2002-06-21 18:14     ` Ted Dennison
replies disabled

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