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!j27g2000yqn.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:15:16 -0800 (PST) Organization: http://groups.google.com Message-ID: <60e4fd81-fd8b-4ea0-972a-95237f0c36ff@j27g2000yqn.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 1268356516 12292 127.0.0.1 (12 Mar 2010 01:15:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 12 Mar 2010 01:15:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j27g2000yqn.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:10505 Date: 2010-03-11T17:15:16-08:00 List-Id: On 12 mar, 01:24, tmo...@acm.org wrote: > > 'Compute' has a generic 'Feedback' procedure for showing progress. > > I could with that way give a Boolean, user_abort, to 'Feedback', and > > 'Compute' would stop when an ad-hoc exception is raised, and return > > normally on its own. > > =A0 Think of a motor and its control panel. =A0The panel does read-only a= ccess > to certain information in the motor, its speed for instance, which the > panel displays. =A0The panel can also write certain information, like Sto= p, > to a switch that the motor periodically (every rotation?) checks. =A0Comp= ute > is your motor and the GUI is the control panel. =A0Progress information > is regularly written by Compute to a record, which is periodically > read by the GUI, and control information is written as needed by the > GUI and regularly read by Compute. Thanks - it is a perfect metaphore. And be reassured, I have no trouble programming this. My question is: would you recommend that way (have a mechanism to tell the motor to stop) in order to have a chance in a reasonable time to stop the "runner daemon" task in its turn ? I am tempted to do so. I was just exploring possibilities of stopping the daemon and the motor in a direct and less polite way, but still good Ada practice. Gautier