1. A method of operating a task scheduler for one or more processors, the method comprising: obtaining a topology of the one or more processors, the topology indicating a plurality of execution units and physical resources associated with each of the plurality of execution units; receiving a task to be performed by the one or more processors; identifying a plurality of available execution units from the plurality of execution units; determining an optimal execution unit, from the plurality of execution units, to which to assign the task, based on the topology and one or more user-specified rules, wherein one of the user-specified rules specifies that a specific task be performed on a specific socket; assigning the task to the optimal execution unit; and sending the task to the optimal execution unit for execution.