I\'m writing an application that will have multiple threads running, and want to throttle the CPU/memory usage of those threads.
There is a similar question for C++,
You can assign different priorities to the threads so the most relevant thread get scheduled more often.
Look at this answer to see if that helps.
When all the running thread have the same priority they may run like this:
t1, t2, t3, t1, t2, t3, t1, t2, t3
When you assign a different priority to one of them it may look like:
t1, t1, t1, t1, t2, t1, t1, t1 t3.
That is, the first thread runs "more often" that the rest.