Throttling CPU/Memory usage of a Thread in Java?

前端 未结 9 2244
借酒劲吻你
借酒劲吻你 2020-12-07 13:00

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++,

9条回答
  •  失恋的感觉
    2020-12-07 13:08

    Why not instead of doing "threading" do cooperative multitasking, would be interesting to see if you can manipulate http://www.janino.net/ to run a program for a certain amount of time/set of intstructions, then stop and run the next program. At least that way its fair, give everyone the same time slice...

提交回复
热议问题