A thread dispatch mechanism dispatches threads in a multiprocessor
computer system that has hardware multithreading enabled, thereby
allowing each processor to execute multiple threads. The thread dispatch
mechanism determines which processors are busy and cannot execute an
additional thread, which processors are working on a thread but can still
accept an additional thread, and which processors are idle. As threads
are ready to be dispatched, each is dispatched to an idle processor
instead of a processor that is already working on another thread. If
there are no idle processors, the thread is dispatched to a processor
working on one or more threads that can still process the new thread. In
this manner the thread dispatch mechanism and method of the present
invention provides greatly improved consistency in response times between
threads and higher throughput compared to prior art methods of
dispatching threads.