comp.lang.ada
 help / color / mirror / Atom feed
From: "James S. Rogers" <jimmaureenrogers@worldnet.att.net>
Subject: Re: Understanding Rendezvous
Date: Sun, 23 Feb 2003 03:48:47 GMT
Date: 2003-02-23T03:48:47+00:00	[thread overview]
Message-ID: <zwX5a.46887$rq4.3864123@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: a5589416.0302221942.5c0034e5@posting.google.com

"Chris" <cp98ak@cosc.brocku.ca> wrote in message
news:a5589416.0302221942.5c0034e5@posting.google.com...
> Hello,
> I am trying to get a grip on how to do different things with Ada,
> using rendezvous. What I desire is a selective accept that will have a
> condition of something like "if this accept is waiting, processes it"
> and the alternate portion of the select will be OTHER code, just
> general code that does whatever (no accepts). I tried it with a
> 'delay' but did not get the proper results.
>
> I.E.:
>
> loop
> select
> when Accept_Ready =>
> accept Data (...,...) do
> ...
> end Data;
> or
> print_this_compute_that();
> end select;
> end loop;
>

You need to use a selective accept with an "else" alternative.

loop
   select
   accept Data(...,...) do
   ...
   end Data;
   else
      print_this_compute_that;
   end select;
end loop;

Jim Rogers





      reply	other threads:[~2003-02-23  3:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-23  3:42 Understanding Rendezvous Chris
2003-02-23  3:48 ` James S. Rogers [this message]
replies disabled

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