This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Multithreading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Multithreading" Watch "Multithreading" New topic


amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231
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
Ranch Hand

Joined: Nov 09, 2000
Posts: 198
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.
I agree. Here's the link:
subject: Multithreading
Similar Threads
JQ plus thread question
Garbage collection thread belongs to which priority..min?normal?max?
what is meant by time-slicing?