- Add SJF
- Re-enable FCFS sorting function - Correct bug in PythonPolicy that wronged return value of is_pre_emptible() git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@435 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
5dddd9b488
commit
7ce8cf93c3
5 changed files with 27 additions and 3 deletions
21
src/builtin-policies/sjf.py
Normal file
21
src/builtin-policies/sjf.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from Policy import Policy
|
||||
import sys
|
||||
|
||||
class sjf(Policy) :
|
||||
def __init__(self):
|
||||
pass;
|
||||
|
||||
def configure(self):
|
||||
print 'No options to configure for fcfs'
|
||||
|
||||
def is_preemptive(self):
|
||||
return False
|
||||
|
||||
def get_time_slice(self):
|
||||
return -1
|
||||
|
||||
def sort_queue(self, event, queue):
|
||||
cmpf = lambda a, b: \
|
||||
a.get_cpu_time_left() < \
|
||||
b.get_cpu_time_left()
|
||||
self.sort(queue,cmpf)
|
Loading…
Add table
Add a link
Reference in a new issue