Table of Content 7
Thread scheduler contains the pool of threads. When threads are started in a program by start() method, then each thread is kept in thread scheduler.
There is no assurance to which thread will get the chance first in the processor. Thread with more priority will be operated first.
JVM has some threads for the execution of a program:
- Main: main is a method but actually, it is a thread for JVM from where the execution starts.
- Garbage Collector(gc()): gc() is a thread that checks after each thread for a garbage value.
- Timer thread: timer threads maintain the time of each thread like wait(), sleep(), etc