next up previous contents
Next: Util Up: Utility classes Previous: ThreadPool

   
Scheduler

The scheduler (JavaGroups.Scheduler) maintains a queue of tasks. It continually processes the first task of the queue (using a reusaable thread and a thread pool) and removes it when done. Tasks are by default added to the end of the queue (Add). However, there is a possibility to process a task with high priority, that means, before all others. Using AddPrio, processing of the current task is suspended, and the new task inserted at the head of the queue and processed immediately. When done, the suspended task is resumed. High priority tasks may preempt previously added high priority tasks, and - when done - will be resumed in the order in which they were suspended.

The scheduler is used by the RequestCorrelator to solve blocking of circular requests causing deadlocks (see 5.2 for details).




1999-08-19