From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!indri!uflorida!gatech!mcnc!ece-csc!ncrcae!hubcap!billwolf%hazel.cs.clemson.edu From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe,2847,) Newsgroups: comp.lang.ada Subject: Re: Asynchronous entry call proposal Message-ID: <5219@hubcap.clemson.edu> Date: 22 Apr 89 15:59:15 GMT References: <124000037@inmet> Sender: news@hubcap.clemson.edu Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu List-Id: >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?