Cache-fair thread scheduling for multicore processors