comp.lang.ada
 help / color / mirror / Atom feed
* Understanding Rendezvous
@ 2003-02-23  3:42 Chris
  2003-02-23  3:48 ` James S. Rogers
  0 siblings, 1 reply; 2+ messages in thread
From: Chris @ 2003-02-23  3:42 UTC (permalink / raw)


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;

I just need to be pointed in the right direction.

TIA,

Chris.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Understanding Rendezvous
  2003-02-23  3:42 Understanding Rendezvous Chris
@ 2003-02-23  3:48 ` James S. Rogers
  0 siblings, 0 replies; 2+ messages in thread
From: James S. Rogers @ 2003-02-23  3:48 UTC (permalink / raw)


"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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-23  3:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-23  3:42 Understanding Rendezvous Chris
2003-02-23  3:48 ` James S. Rogers

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