1. A computer implemented method for scheduling threads in a data processing system having a multi-core processor, the computer implemented method comprising: selecting a first thread according to an order in a scheduling discipline, the first thread being a thread of an application executing in the data processing system, the first thread forming the leader thread in a bundle of threads; determining a value of a core attribute in a set of core attributes according to a corresponding thread attribute in a set of thread attributes associated with the leader thread; determining whether a second thread can be added to the bundle of threads such that the bundle including the second thread will satisfy a policy; adding, responsive to the determining being affirmative that the second thread can be added, the second thread to the bundle; forming a second bundle of threads using a third thread and a fourth thread, the threads in the bundle of threads have a first value of the thread attribute and the threads in the second bundle of threads have a second value of the thread attribute, wherein the first and the second values are within a tolerance of the core attribute; concluding that co-scheduling all threads in the bundle using a core of the multi-core processor does not comply with a condition on using the core; determining, responsive to the concluding that co-scheduling all threads in the bundle and the second bundle using the core of the multi-core processor complies with the condition on using the core; and scheduling, responsive to determining that the co-scheduling all threads in the bundle and the second bundle complies with the condition, the bundle and the second bundle for co-execution using the core of the multi-core processor.