Thursday, February 22, 2007

Scheduling in Java

The classic ways of sharing processor by various threads is Preemptive Scheduling and Time Slicing.

Some designs based on Pipeline work model can be well achieved with Preemptive Scheduling. Designs based on Pool of Workers that execute independent tasks can be well achieved with Time Slicing model. The type of scheduling is also influenced by the support offered by OS for multi-threading.

Java as a language is platform independent and does not allow user to dictate on type of scheduling to use for that particular application. Even though it is possible to specify priorities for a thread, the question of honoring priorities is subject to a particular JVM implementation and the respective OS. We have to believe that the JVM is best designed to give optimal performance for all applications irrespective of their design paradigm.

No comments: