permaculture playing cards
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread " Watch "Thread " New topic


rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
Good moring to all,
What is Preemptive Schulde,Round Robin Schedule?
chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

Scheduling with respect to Operatiing systems.Same logic is applicable everywhere.
Scheduling is of 2 types

In Preemptive scheduling,resource once allocated to a process cannot be taken back by the OS until the process having the resource releases it
In nonPreemptive scheduling, resource once allocated can be taken back by the OS when needed

For example:

Consider process P1 has Resource R1 for 10 seconds, but on 5th second suppose Process P2 having higher priority than P1 requests for Resource R1, then OS will take the resource from P1 and give it to P2,this is done in Preemptive Scheduling. In non Preemptive Scheduling, the resource can be allocated to some other process only after the 10th second.

Round robin Scheduling

In round robin a time block(t1 seconds) is selected and each process can access it for t1 seconds.

For Example

Process Resource Required Time
P1 R1 5
P2 R1 5
P3 R1 5

Let time block(t1) be 2 secs

Therefore the resource is allocated in the following order
P1: 0-2seconds
P2: 2-4seconds
P3: 4-6seconds

Then again P1 from 6-8seconds and so on

Hope this helps

Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
anveshana bandu
Ranch Hand

Joined: Oct 09, 2007
Posts: 42
Hai everyone

I want one small help...

I was planning to write scjp 1.5 as soon as possible...

I was comfortable with most of the topics..but threads i couldnot concentrate............and feeling boring to read threads....
but i should read for the exam any how............

Please help me how to develop interest in threads............
Please reply with out fail..........

I am very much thankful to you.............
I agree. Here's the link:
subject: Thread
jQuery in Action, 3rd edition