[saga-rg] BOUNCE saga-rg at ggf.org: Admin request of type /\bcancel\b/i at line 4 Admin request of type /\bcancel\b/i at line 6 (fwd)

Shantenu Jha s.jha at ucl.ac.uk
Thu Aug 25 09:59:52 CDT 2005


From: Andre Merzky <andre at merzky.net>
To: Tom Goodale <goodale at cct.lsu.edu>
Cc: Simple API for Grid Applications WG <saga-rg at ggf.org>
Subject: Re: [saga-rg] wait on tasks...

I think it would be nice to avoid the need for try/catch for
wait, at least for the situation when the task finishes
peacefully (enters Finished state).  I agree that a
concurrent cancel from the same application should be
catchable, as that indicates a flaw in application logic
(cancel in one thread, wait in another). 

So your proposed policy of allowing a wait to simply return
success as long as the parameters are in a usable state, or
to simply fails as long as the task might get into Finished
state, would be a good solution.

Andre.


Quoting [Tom Goodale] (Aug 25 2005):
> 
> 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



-- 
+-----------------------------------------------------------------+
| Andre Merzky                      | phon: +31 - 20 - 598 - 7759 |
| Vrije Universiteit Amsterdam (VU) | fax : +31 - 20 - 598 - 7653 |
| Dept. of Computer Science         | mail: merzky at cs.vu.nl       |
| De Boelelaan 1083a                | www:  http://www.merzky.net |
| 1081 HV Amsterdam, Netherlands    |                             |
+-----------------------------------------------------------------+







More information about the saga-rg mailing list