- Added Policy::wants() and updated related code. Scheduler::get_ready_queue() still always returns a process queue...
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@615 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
e5b90a39ad
commit
1e75fe91f1
9 changed files with 81 additions and 4 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
from Policy import Policy
|
||||
import sys
|
||||
from sgpem import policy_sorts_processes
|
||||
|
||||
class fcfs(Policy) :
|
||||
def __init__(self):
|
||||
|
@ -35,6 +36,9 @@ class fcfs(Policy) :
|
|||
def get_time_slice(self):
|
||||
return -2
|
||||
|
||||
def wants(self):
|
||||
return policy_sorts_processes
|
||||
|
||||
def sort_queue(self, queue):
|
||||
cmpf = lambda a, b: \
|
||||
a.get_schedulable().get_arrival_time() < \
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
from Policy import Policy
|
||||
import sys
|
||||
from sgpem import policy_sorts_processes
|
||||
|
||||
class sjf(Policy) :
|
||||
def __init__(self):
|
||||
|
@ -35,6 +36,9 @@ class sjf(Policy) :
|
|||
def get_time_slice(self):
|
||||
return -1
|
||||
|
||||
def wants(self):
|
||||
return policy_sorts_processes
|
||||
|
||||
def sort_queue(self, queue):
|
||||
cmpf = lambda a, b: \
|
||||
a.get_cpu_time_left() < \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue