multithreading - How to schedule Java Threads -


i have read java threads user-level threads , 1 of differences between user level threads , kernel level threads kernel level threads scheduled kernel(we cannot change it) user level threads can define our own scheduling algorithm.

so how schedule threads in java? @ given time, when multiple threads ready executed, runtime system chooses runnable thread highest priority execution. if 2 threads of same priority waiting cpu, scheduler chooses 1 of them run in round-robin fashion. if don't want rr? there way can change or missing here?

you cannot change scheduling algorithm jvm outside scope. jvm uses threading of user threads provided underlying os.

so java perspective cannot change scheduling algorithm. scheduling done automatically.

the thing in java can set priority of thread. how affects scheduling algorithm not defined.

you can try change scheduling algorithm of os vm running on. highly dependend on os used.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -