1. A method for grouping two or more threads based on lock contention information, wherein the method comprises: determining lock contention information with respect to two or more threads; using the lock contention information with respect to the two or more threads to determine lock affinity between the two or more threads; using the lock affinity between the two or more threads to group the two or more threads into one or more thread clusters; and using the one or more thread clusters to perform scheduling of one or more threads.