On 7/5/2010 8:39 PM, Peter Firmstone wrote:
Patricia Shanahan wrote:
Peter Firmstone wrote:
...
This is where you have to be careful of Distributed computing, I
think you'd have to branch out in both directions, checking older and
younger tasks as the tasks arrival may be a combination of processing
remote and local calls. In fact a task might arrive so far out of
sequence that it could be at the opposite end of the queue.
...

So what happens if Task x arrives so late that we have already done
the runAfter tests for Task y, but y should run after x?

Patricia

Hmm, yes I was just thinking that, need to look at the implementations
again...


I've checked both the comments and the code. The TaskManager class Javadoc comment talks about "not required to run after any of the tasks that precede it in the queue", and I believe that is the way it is implemented. For example, takeTask sets the size to i in the runAfter call for a candidate at index i in the list.

It seems to be the caller's responsibility to make sure that a task is not added to a TaskManager until after any task it needs to run after.

Patricia

Reply via email to