[Pydra] Task scheduling code preview

Peter Krenesky peter at osuosl.org
Mon Jun 8 16:00:11 UTC 2009

The repo works now.

Looks like you are on the right path. 

I like the idea of using the observer (listener) pattern.  we may need
to use this more as pydra is modularized so that components arent as
tightly coupled

== TaskInstance and TaskExecutionRecord ==
I think we should combine the TaskInstance Model and TaskExecutionRecord
class.  They are both used for tracking status of a task and have
overlapping fields.  Combining them will simplify saving and loading
from the database.  I don't have a preference to which name is used,
they both make sense. 

== time.sleep ==
time.sleep cannot be called within a twisted app.  It may put all of the
threads to sleep causing other things to stop running.  If you need to
delay running a function you can use reactor.callLater(_seconds, _func,
*args, **kw) to get the same effect.

== stopping tasks ==
It would be more efficient to return tasks to the idle pool as they
stop.  Its impossible to know when a task will honor a stop flag, if at
all.  worst case scenario is not at all.  Workers will complete their
work units at different times.

The best thing to do is remove or flag the TaskRecord so no more workers
are assigned, and return workers to the idle pool as they stop or complete.

Yin QIU wrote:
> On Mon, Jun 8, 2009 at 10:03 PM, Peter Krenesky<peter at osuosl.org> wrote:
>> Hi yin,
>> I checked out your repo but didn't see any code committed in either the
>> master or sched_experiment branches.
> Uh, looks like I still have a long way to go with git.
> Can you try it again now (i.e., )?

More information about the Pydra mailing list