
Hi all, the wait currently throws a NotRunning exception if the tast is not running anymore. That basically mean that _every_ wait has to be put into a try/catch, since the programmer does not know in advance if the task is still active. We would like to propose to change that behaviour, and just return immediately on wait, even if it is called multiple times. A NotRunning exception should only be thrown if the task was cancelled before. The same should hold for the TaskContainer. Any opinions to that? Cheers, Andre. -- +-----------------------------------------------------------------+ | Andre Merzky | phon: +31 - 20 - 598 - 7759 | | Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 | | Dept. of Computer Science | mail: merzky@cs.vu.nl | | De Boelelaan 1083a | www: http://www.merzky.net | | 1081 HV Amsterdam, Netherlands | | +-----------------------------------------------------------------+

On Wed, 17 Aug 2005, Andre Merzky wrote:
Hi all,
the wait currently throws a NotRunning exception if the tast is not running anymore. That basically mean that _every_ wait has to be put into a try/catch, since the programmer does not know in advance if the task is still active.
The can do a getState on the task.
We would like to propose to change that behaviour, and just return immediately on wait, even if it is called multiple times. A NotRunning exception should only be thrown if the task was cancelled before.
or if the task has not been run. Basically we need an exception in any case that the wait can return but the output arguments of the task are invalid.
The same should hold for the TaskContainer.
Yep. Tom

Quoting [Tom Goodale] (Aug 25 2005):
On Wed, 17 Aug 2005, Andre Merzky wrote:
Hi all,
the wait currently throws a NotRunning exception if the tast is not running anymore. That basically mean that _every_ wait has to be put into a try/catch, since the programmer does not know in advance if the task is still active.
The can do a getState on the task.
You have a race condition then: state = task.getState (); # task finishes now if ( state == Running ) { task.wait (-1.0); # throws an NotRunning exception } So that does not help.
We would like to propose to change that behaviour, and just return immediately on wait, even if it is called multiple times. A NotRunning exception should only be thrown if the task was cancelled before.
or if the task has not been run. Basically we need an exception in any case that the wait can return but the output arguments of the task are invalid.
Right. That would be a good policy.
The same should hold for the TaskContainer.
Yep.
Tom
Cheers, Andre. -- +-----------------------------------------------------------------+ | Andre Merzky | phon: +31 - 20 - 598 - 7759 | | Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 | | Dept. of Computer Science | mail: merzky@cs.vu.nl | | De Boelelaan 1083a | www: http://www.merzky.net | | 1081 HV Amsterdam, Netherlands | | +-----------------------------------------------------------------+

On Thu, 25 Aug 2005, Andre Merzky wrote:
Quoting [Tom Goodale] (Aug 25 2005):
On Wed, 17 Aug 2005, Andre Merzky wrote:
Hi all,
the wait currently throws a NotRunning exception if the tast is not running anymore. That basically mean that _every_ wait has to be put into a try/catch, since the programmer does not know in advance if the task is still active.
The can do a getState on the task.
You have a race condition then:
state = task.getState ();
# task finishes now
if ( state == Running ) { task.wait (-1.0); # throws an NotRunning exception }
So that does not help.
Good point, but it does if we also change the exception, although they still might want to put a try around it to catch someone cancelling the task in the meantime; on the other hand since that could only happen from within the same program, it's probably something the programmer can decide if they need to do. Tom
participants (2)
-
Andre Merzky
-
Tom Goodale