comp.lang.ada
 help / color / mirror / Atom feed
From: Martyn Pike <usenet@embeddedconsultinguk.com>
Subject: Re: Example question
Date: Sun, 26 Oct 2014 14:18:50 +0000
Date: 2014-10-26T14:18:50+00:00	[thread overview]
Message-ID: <544d02cc$0$14840$c00b7f07@94.232.116.90> (raw)
In-Reply-To: <0fbd755d-7bcf-42b1-a20b-c6a2c74c7d6e@googlegroups.com>

On 26/10/2014 13:27, compguy45@gmail.com wrote:
> body Spreadsheet_Task is
>      begin
>          loop
>              select
>                  accept Recalculate;
>                  Do_Recalculation;
>              or
>                  accept Shutdown;
>                  exit;
>              end select;
>          end loop;
>      end Spreadsheet_Task;
>
> Tutorial says "If calls to both entries are already pending, one will be accepted non-deterministically." what does that mean? If calls are pending on bith entries it might happend that Shutdown is accepted and exits in which case thats not good solution at all
>
>

It basically means exactly what you said.  If calls are pending on both 
entries then it is not deterministic as to which one will be processed 
first.

If you want deterministic behaviour then in my opinion this is where 
protected objects should be used.  Particularly if you absolutely must 
check for the existence of a Shutdown event before checking for a 
Recalculate event.

Martyn


  reply	other threads:[~2014-10-26 14:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-26 13:27 Example question compguy45
2014-10-26 14:18 ` Martyn Pike [this message]
2014-10-26 15:46   ` J-P. Rosen
2014-10-26 16:53     ` Martyn Pike
2014-10-26 14:21 ` Shark8
2014-10-26 15:42   ` Simon Wright
2014-10-26 15:48   ` Robert A Duff
2014-10-26 14:33 ` Niklas Holsti
replies disabled

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