comp.lang.ada
 help / color / mirror / Atom feed
From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,)
Subject: Re: Asynchronous entry call proposal
Date: 22 Apr 89 15:59:15 GMT	[thread overview]
Message-ID: <5219@hubcap.clemson.edu> (raw)
In-Reply-To: 124000037@inmet

From article <124000037@inmet>, by stt@inmet:
> Here is the proposed new selective wait construct:
> 
> select
>    select_alternative
> { or 
>     select_alternative}
> and
>    sequence_of_statements
> end select;
> 
> The semantics of this construct are that normal processing is performed 
> on the select alternative guards to determine which should be "open."  
> Selection of one such open alternative takes place immediately if a 
> rendezvous is possible, or if a delay alternative of less than or equal 
> to zero seconds is open.  Otherwise, the sequence_of_statements begin 
> execution.  If the sequence_of_statements completes execution,
> then the select alternatives are closed.

    So far, what we have is precisely identical to the existing construct:

      select
         select_alternative
    { or 
         select_alternative }
    [ else
         sequence_of_statements ]
      end select;
   
> If prior to completion of the sequence_of_statements and outside of
> any nested rendezvous (either accept or entry call), a delay alternative 
> has expired, or an open accept alternative has a caller, then the 
> sequence_of_statements is abandoned, and an asynchronous transfer
> of control takes place to the appropriate open select alternative.
> This abandonment takes place no later than the next synchronization
> point, but it is the intent that any ongoing computation 
> (outside of a rendezvous) be preempted.  [...]  Example of use:
>
>     select  -- Perform time-limited calculation
> 	delay 5.0;
> 	Put_Line("Calculation does not converge");
>     and
> 	-- This calculation should finish in 5.0 seconds
>         -- if not, it is assumed to diverge
>         Horribly_Complicated_Recursive_Function(X, Y);
>     end select;

   This can be accomplished now by wrapping the function
   up in a task, activating it, delaying 5.0, and then 
   killing it off if it hasn't completed...

   > It was felt by most of the participants of [IWRT2] that
   > this approach was unacceptably expensive and inadequately
   > controllable.  

   But this will essentially have to be done anyway; it seems
   that this proposal would simply move the abort of the 
   sequence_of_statements "behind the scenes".  What improvement
   is being made which could not be applied more directly to simply 
   making the existing abort statement deliver better performance?


   Bill Wolfe, wtwolfe@hubcap.clemson.edu

   P.S. I also didn't see any discussion of how the proposed
        "abortable else" would interact with the existing,
        non-abortable else section...  what if the programmer
        supplied both?  Or are you making them mutually exclusive?
 

  reply	other threads:[~1989-04-22 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-04-20 17:20 Asynchronous entry call proposal stt
1989-04-22 15:59 ` William Thomas Wolfe,2847, [this message]
1989-05-04 21:05   ` Tucker Taft
replies disabled

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