Fixed task switching algorithm