This is definitely a terrible idea.
Generally speaking, setting a thread or process priority is a bad idea because it is not deterministic and you can starve from other threads / processes in action. In addition, you can really increase the priority of threads / processes with lower priority due to starvation.
In addition, thread pool threads are for reuse, and by changing the priority of the thread, you change the wait for the task that will receive the thread for use after starting your program.
If you have two options. If you only need to prioritize your tasks and not mind if other elements that are not related to your tasks are executed before you, then you can use the thread pool with a consumer-producer template, with some wrapper code that will take the highest priority from your turn.
If you want threads to perform only your tasks, you need to create your own thread pool (using the System.Thread class), and then do the same using the shell code so that the task runs based on priority.
New classes in the System.Threading namespace in .NET 4.0 (not yet released) will handle creating a separate thread pool for you.
source share