comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier write-only <gautier_niouzes@hotmail.com>
Subject: Re: Q: Stopping a task running a long simulation
Date: Thu, 11 Mar 2010 17:50:00 -0800 (PST)
Date: 2010-03-11T17:50:00-08:00	[thread overview]
Message-ID: <2fcc6b45-8ad2-4ace-9d32-19ac39c06280@o3g2000yqb.googlegroups.com> (raw)
In-Reply-To: e4b75f1d-b0a7-4067-8433-dbe74add709f@b9g2000pri.googlegroups.com

> 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 ?

> But I think this would work and might be better than the "abort" meat-axe 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



  reply	other threads:[~2010-03-12  1:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11 13:08 Q: Stopping a task running a long simulation Gautier write-only
2010-03-11 18:11 ` Anh Vo
2010-03-12  0:24 ` tmoran
2010-03-12  1:15   ` Gautier write-only
2010-03-12  1:27 ` Adam Beneschan
2010-03-12  1:50   ` Gautier write-only [this message]
2010-03-12  2:03   ` Gautier write-only
replies disabled

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