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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6516065ab7b5a533 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!o3g2000yqb.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Q: Stopping a task running a long simulation Date: Thu, 11 Mar 2010 17:50:00 -0800 (PST) Organization: http://groups.google.com Message-ID: <2fcc6b45-8ad2-4ace-9d32-19ac39c06280@o3g2000yqb.googlegroups.com> References: NNTP-Posting-Host: 81.62.183.49 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1268358601 6107 127.0.0.1 (12 Mar 2010 01:50:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 12 Mar 2010 01:50:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o3g2000yqb.googlegroups.com; posting-host=81.62.183.49; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/533.1 (KHTML, like Gecko) Chrome/5.0.321.0 Safari/533.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:10507 Date: 2010-03-11T17:50:00-08:00 List-Id: > You're saying Feedback would check something to see if another task > wants to abort it, and raise an exception if the answer is "yes"? That's it (the exception being only internal to Compute, for reaching its end quickly; probably I'll use an 'exit when' instead). The feedback procedure would look like: http://unzip-ada.sourceforge.net/za_html/zip__ads.htm#218_8 > I'd use a protected object for that (as opposed to a global Boolean > user_abort as you seem to be suggesting). Thanks - indeed in a way or the other, there would a Boolean written (and only written) by the GUI action and read (and only read) by Feedback, randomly. Isn't the pragma Volatile sufficient in such a case ? >=A0But I think this would work and might be better than the "abort" meat-a= xe approach. Thanks for the advice - indeed thinking further, it would be also useful for a "Stop" UI command, where the simulation is just interrupted, but the daemon would be kept alive for other simulations. Gautier