Described is a method and apparatus for processing tasks in a data processing
system including a microprocessor and an instruction cache. Tasks of different
types are defined in the system with each task type having code associated therewith.
The tasks are managed in a queue and are processed in order by loading the associated
code into the instruction cache for execution on the microprocessor. The method
comprises the steps of scheduling tasks of like type into a batch such that tasks
in a batch are processed before processing the next ordered task. In the case where
the code associated with a batched task fits within the instruction cache, the
tasks in a batch can be processed without incurring the penalty associated with
instruction cache misses.