Can we change the JVM thread scheduler?

Is it possible to change the JVM thread scheduler . Suppose my JVM is working on proactive thread scheduling , than I can change it in my custom thread scheduling algorithm, or the JVM provides options for the scheduler.

+4
source share
3 answers

In general, the JVM does not carry out any planning. This is the task of the OS. For example, Linux has custom scheduling options, and if you want to add a new scheduling strategy, you can change the kernel.

However, depending on why you want to do this, you can solve the problem in another way, for example, using the custom Executor shell or the Reactor style structure, or effectively disable scheduling for the processor and do all the work in Java yourself. (Not a trivial topic, rarely very useful)

+7
source

IMHO, we do not have much control over thread scheduling. Most modern JVM delegates are passed to native os when it comes to thread scheduling. Some Solaris jvms, I heard, still use the concept of Green Streams. This is probably the best chance of what you are trying to achieve. I do not have a car for solar panels, so I can not confirm this.

. 1) . .

, os, http://docs.oracle.com/cd/E24290_01/coh.371/e22838/tune_perftune.htm#CACCHIFA

+5

Is it possible to change the JVM thread scheduler.

No, because there is nothing to change. This is in the operating system. Any link you may encounter in a JVM thread schedule is, at best, incorrect dates in the distant future.

+1
source

Source: https://habr.com/ru/post/1538825/


All Articles