Patent ID: 8141083

Claim:
A method in a shared processor data processing system for dynamically determining when to yield a processor that is assigned to perform particular work but that is currently idle, said method comprising: assigning a particular one of a plurality of processors to perform work; in response to the particular one of the plurality of processors becoming idle: starting an execution of an idle thread by the particular one of the plurality of processors; setting, by the idle thread, a first timestamp; and determining, by the idle thread, a length of time the particular one of the plurality of processors has been idle; determining, by the idle thread, whether the particular one of the plurality of processors is no longer idle; in response to the idle thread determining that the particular one of the plurality of processors is no longer idle: setting, by the idle thread, a second timestamp; determining, by the idle thread, an idle interval by determining a difference between the first timestamp and the second timestamp, wherein the time between the particular one of the plurality of processors becoming idle and the particular one of the plurality of processors no longer being idle is the idle interval; incrementing, by the idle thread, a number of intervals, wherein the number of intervals is a total number of times that each one of the plurality of processors became idle and said each one of the plurality of processors was thereafter no longer idle; adding, by the idle thread, the idle interval to an idle accumulator, wherein the idle accumulator is a total amount of time that all of the plurality of processors have spent idling during all of the intervals; computing, by the idle thread, an average time spent idling by dividing the idle accumulator by the number of intervals; and setting, by the idle thread, an idle threshold equal to the average time spent idling; dynamically adjusting, by the idle thread, the idle threshold during runtime without user intervention by autonomically adjusting the idle threshold to a new value that is computed using an adjusted idle interval, an adjusted number of intervals, and an adjusted average time spent idling; and in response to the length of time exceeding the idle threshold, making the particular processor available to perform other work.