1.

What is Thread Scheduler and Time Slicing?

Answer»

Thread Scheduler: It is a component of JVM that is used to decide which thread will execute next if multiple threads are waiting to get the chance of execution. By looking at the PRIORITY assigned to each thread that is READY, the thread scheduler selects the next run to execute. To schedule the threads, it mainly uses two mechanisms: Preemptive Scheduling and Time slicing scheduling.  

Time Slicing: It is especially used to divide CPU time and allocate them to ACTIVE threads. In this, each thread will get a predefined slice of time to execute. When the time expires, a particular thread has to wait till other threads get their CHANCES to USE their time in a round-robin FASHION. Every running thread will get executed for a fixed time period. 



Discussion

No Comment Found