From: mheaney@ni.net (Matthew Heaney)
Subject: Re: Task question
Date: 1997/10/08
Date: 1997-10-08T00:00:00+00:00 [thread overview]
Message-ID: <mheaney-ya023680000810970917440001@news.ni.net> (raw)
In-Reply-To: 61d2bf$f0n$1@polo.advicom.net
In article <61d2bf$f0n$1@polo.advicom.net>, "David C. Hoos, Sr."
<david.c.hoos.sr@ada95.com> wrote:
>Yes. Make your task body look like:
>
>task body x is
> Finished : Boolean := False
>begin
> loop
> select
> accept my_rendezvous (some_data: some_data_type) do
> -- Rendezvous stuff
> end my_rendezvous;
> or
> accept done do
> Finished := True;
> end done;
> end select;
> exit when Finished;
> end loop;
> -- Now do more stuff.
>end x;
How about
task body x is
begin
loop
select
accept my_rendezvous (some_data: some_data_type) do
-- Rendezvous stuff
end my_rendezvous;
or
accept done;
exit;
end select;
end loop;
-- Now do more stuff.
end x;
I don't think the flag is required.
This is similar to the idiom for shutting down a task:
task body T is
begin
Main:
loop
select
accept E;
<do some work>
or
accept Shutdown;
exit Main;
end select;
end loop Main;
<perform cleanup>
end T;
--------------------------------------------------------------------
Matthew Heaney
Software Development Consultant
<mailto:matthew_heaney@acm.org>
(818) 985-1271
next prev parent reply other threads:[~1997-10-08 0:00 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-10-06 0:00 Task question Larry Coon
1997-10-07 0:00 ` Robert A Duff
1997-10-13 0:00 ` Larry Coon
1997-10-07 0:00 ` Matthew Heaney
1997-10-07 0:00 ` Larry Coon
1997-10-07 0:00 ` David C. Hoos, Sr.
1997-10-07 0:00 ` Steve O'Neill
1997-10-07 0:00 ` Larry Coon
1997-10-08 0:00 ` Tom Moran
1997-10-08 0:00 ` Matthew Heaney [this message]
1997-10-30 0:00 ` Balmacara9
-- strict thread matches above, loose matches on Subject: below --
2007-12-10 22:12 shaunpatterson
2007-12-10 22:29 ` gpriv
2007-12-10 22:51 ` shaunpatterson
2007-12-10 23:13 ` gpriv
2007-12-10 23:40 ` Robert A Duff
2007-12-11 0:43 ` anon
1997-10-16 0:00 Paul Van Gorp
1997-10-19 0:00 ` elaine.waybright
1997-11-01 0:00 ` Matthew Heaney
1997-10-21 0:00 ` Robert A Duff
1996-09-15 0:00 task question Nicolay Belofastow
1996-09-23 0:00 ` Matthew Heaney
[not found] <204266@QZCOM>
1986-09-26 17:28 ` Task question Matts_Kallioniemi_QZ
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox