A small template in cpu scheduling, particularly in preempitive priority