@Tarun Yes, but the JVM is a virtual machine (which is what the VM in JVM means), so it takes over parts of the work.
On a higher level, the underlying OS necessarily has to do some scheduling, but the JVM directly handles Java threads, while the OS handles the JVM threads, which includes Java threads.
@Zoe Do you mean JVM scheduling at process level and OS scheduling at System level. Is this understanding correct. I mean to say while JVM decides which java threads gets executed next, while OS decide while next thread (that could be java one) among all threads running on the system gets executed next.
More or less, but from what I've understood, the JVM has threads managed by the OS, and each thread might map to a Java thread, but I'm not entirely sure
What does fairness parameter means then. If Its the OS that has to take the final call, why Java lets programmer to specify fairness parameter to schedule a thread that has been waiting the most.