How linux schedules threads and processes