Priority process dispatcher in C