I'm trying to create a server queue to take in user specified jobs and

first) sort them by importance, and

second) execute them as cpu availability permits.

What are my best options? Is there anything built-in or perhaps load
some code from somewehre else?
The users will simply send their jobs to the queue script.

Any help would be greatly appeciated. Thanks