Implementing priority scheduling