Patent ID: 8621479

Claim:
A computer-implemented method for use in performing a task by at least one processing engine, said method comprising: determining a task allocation metric associated with at least one processor having at least one processing engine, the at least one processing engine having a plurality of processing cores, each processing core haying one or more threads, wherein the task includes a plurality of subtasks; assigning the task to one of the one or more threads and performing task allocation according to the task allocation metric indicating a task should be performed using either (a) a load balancing method or (b) a core affinity method; performing a load balancing method if the task allocation metric indicates load balancing associated with the at least one processor is below a first threshold, the load balancing method including: determining by the at least one processing engine whether the task is a reentrant task, wherein the task is a reentrant task if the task has been previously assigned to any of said one or more threads associated with the at least one processing engine; if the task is a reentrant task, determining, by the at least one processing engine, whether a stopping criteria is satisfied, wherein the stopping criteria includes determining whether some or all of the subtasks subordinate to the task are completed; and if the stopping criteria is not satisfied and the task is a reentrant task, freeing said one of the one or more threads after re-entering the task into a queue of tasks associated with the at least one processing engine; performing a core affinity method if the task allocation metric indicates core affinity associated with the at least one processor is below a second threshold, wherein the core affinity method includes: determining, by the at least one processing engine, whether the task is a main task, wherein the main task is a task having at least one subtask, but is not a subtask to other tasks; if the task is not a main task, determining, by the at least one processing engine, whether the stopping criteria is satisfied; and if the stopping criteria is satisfied and the task is not a main task, assigning a parent task of the task to said same one of the one or more threads.