hi everybody, java supports pre-emptive multitheading but it depend s on the OS to give the priority to the threads. WinNT and 95 support time slicing, so how are we going to answer qns based on thread scheduling?? What is the exact difference between preemptive and time slicing?
Bharatesh H Kakamari
posted 15 years ago
Time Slicing principle : The Thread Scheduler allocates some pre-defined time for every thread to run. After this period another thread gets the time slice that is chance to execute. Again when the period ends another thread in the Scheduler's pool is executed. Pre-emptive principle : In this principle the Thread Scheduler pre-empts a thread with low priority giving a thread with higher priority to run. Here the priority of the Thread takes importance than the time slicing. Pre-empting means the OS copies the memory space / Thread image to secondary storage in the state it is before another thread is given a chance to execute. HTH