A method, apparatus, and computer program product are disclosed for a
simultaneous multithreading (SMT) data processing system for modifying
the processing of software threads that acquire a contentious software
lock. The system includes a processor that is capable of concurrently
executing multiple different threads on the processor. The processor is
also capable of utilizing hardware thread priorities assigned to each
thread the processor is processing by granting a greater, disparate
amount of resources to the highest priority thread. A hardware priority
is assigned to each one of the SMT threads. A contentious lock is
identified. Ones of the multiple threads are identified that attempt to
acquire the contentious lock. These threads are dynamically redirected to
special code for handling contentious locks. The hardware priority of a
thread acquiring a contentious lock is then boosted. According to the
preferred embodiment, the present invention redirects callers of a
locking function to a "hot" locking function when the lock they are
acquiring has been classified as "hot", and vice versa.