I want to run tasks with priority, i.e. among several simultaneous running tasks, the task with the higher priority will have more chances to occupy CPU time. I have the following 2 issues dealing with the implementation of such feature.
- To define each task as a thread or as a method? How to change the priority of each task dynamically when they are running?
- The priority feature of Java thread does not meet my requirement, since I can not define priority precisely. For example, I want to define that a task with priority A will occupy CPU time 3 times than a task with priority B.
I am wondering whether I can find similar open source projects or tutorials?
Thanks in advance,