|
Re: Eclipse Job framework: FIFO queue that respects priority? [message #545488 is a reply to message #545408] |
Thu, 08 July 2010 03:07 |
Randy Hudson Messages: 123 Registered: July 2009 |
Senior Member |
|
|
It sounds like you've already implemented a scheduling rule that compares timestamps. Maybe that rule should first compare the priorities, and then only compare timestamps when the priorities are equal.
It's funny, I just implemented a similar scheduling rule today. I have jobs A and B, and I want B to only be scheduled after A has been completed. However, I ran into a problem. I'm doing:
A.schedule(8000);
B.schedule();
But since A is scheduled with a delay, I have problems. Unfortunately, it seems like the scheduling rule for B is only consulted if A is currently running. But since A was delayed, B gets scheduled and runs before A.
If this is how scheduling rules work, then they aren't really useful for scheduling. Actually, aren't they just mutexes? The rules I used for jobs A and B aren't symmetric, but the javadoc for isConflicting() says that the method must be symmetric, which again sounds more like a mutex.
I'd like to be told otherwise, but it sounds like if you want to guarantee the order in which jobs run, you have to do your own scheduling and only use ISchedulingRule for avoiding deadlocks.
|
|
|
Re: Eclipse Job framework: FIFO queue that respects priority? [message #545526 is a reply to message #545488] |
Thu, 08 July 2010 07:40 |
Anders Baumann Messages: 55 Registered: July 2009 |
Member |
|
|
Hi Randy.
Thanks for your answer. I agree. It seems like the scheduling rules act more
like mutexes.
How do you suggest that I do my own scheduling if I still want to use the
Job framework? Do you suggest that I manually reorder the job queue when I
schedule a new job?
Best regards,
Anders
> It sounds like you've already implemented a scheduling rule that compares
> timestamps. Maybe that rule should first compare the priorities, and then
> only compare timestamps when the priorities are equal.
> It's funny, I just implemented a similar scheduling rule today. I have
> jobs A and B, and I want B to only be scheduled after A has been
> completed. However, I ran into a problem. I'm doing:
>
> A.schedule(8000);
> B.schedule();
>
> But since A is scheduled with a delay, I have problems. Unfortunately, it
> seems like the scheduling rule for B is only consulted if A is currently
> running. But since A was delayed, B gets scheduled and runs before A.
>
> If this is how scheduling rules work, then they aren't really useful for
> scheduling. Actually, aren't they just mutexes? The rules I used for
> jobs A and B aren't symmetric, but the javadoc for isConflicting() says
> that the method must be symmetric, which again sounds more like a mutex.
>
> I'd like to be told otherwise, but it sounds like if you want to guarantee
> the order in which jobs run, you have to do your own scheduling and only
> use ISchedulingRule for avoiding deadlocks.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03358 seconds