Priority scheduling algorithm for processor scheduling