I'm investigate about synchronized block and scheduling rules. I know that both methods are used to guarantee synchronous data. But I don't understand them, how they work. What are the advantage and disadvantage of synchronized and scheduling rules? I referd the instruction about scheduling rules here: http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fruntime_jobs_rules.htm In this document, it represented about a rule as below:
We can fix this example by creating a simple scheduling rule that acts as a mutex (also known as a binary semaphore):
class Mutex implements ISchedulingRule {
public boolean isConflicting(ISchedulingRule rule) {
return rule == this;
}
public boolean contains(ISchedulingRule rule) {
return rule == this;
} }
Then, the rule is set into a object or method to control jobs. In this code, I don't see rule as well as how to check rule. And when is the scheduling rule or synchronized used?
Thank in advance