Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the JVM thread scheduling algorithm?

I am really curious about how the JVM works with threads!

In my searches on the internet, I found some material about RTSJ, but I don't know if it's the right directions for my answers.

Can someone give me directions, material, articles or suggestions about the JVM scheduling algorithm?

I am also looking for information about the default configuration of Java threads in the scheduler, like how long does it take for every thread in case of time-slicing.

I appreciate any help, thank you!

like image 312
mrcaramori Avatar asked May 12 '10 03:05

mrcaramori


1 Answers

There is no single Java Virtual Machine; JVM is a specification, and there are multiple implementations of it, including the OpenJDK version and the Sun version of it, among others. I don't know for certain, but I would guess that any reasonable JVM would simply use the underlying threading mechanism provided by the OS, which would imply POSIX Threads (pthreads) on UNIX (Mac OS X, Linux, etc.) and would imply WIN32 threads on Windows. Typically, those systems use a round-robin strategy by default.

like image 60
Michael Aaron Safyan Avatar answered Oct 11 '22 19:10

Michael Aaron Safyan