- Implement first draft of quicksort in Python
- Extend test to have a set of processes (now lacks significative output) - Extend FCFS policy to do something useful - FIXME : segfaults on sortQueue() - FIXME : needs implementation for SchedulableQueue.swap() git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@389 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
7110279f53
commit
73a3e72118
6 changed files with 102 additions and 43 deletions
|
@ -1,18 +1,5 @@
|
|||
from Policy import Policy
|
||||
|
||||
##### Typical session : #######
|
||||
###############################
|
||||
# cd [...]/share/sgpemv2/policies
|
||||
# python
|
||||
# >>> import sys
|
||||
# >>> sys.path[:0] = [ '../modules' ]
|
||||
# >>> import fcfs
|
||||
# >>> p = fcfs.fcfs_policy()
|
||||
# >>> par = p.get_parameters()
|
||||
# Segmentation fault
|
||||
# (this makes sense...)
|
||||
###############################
|
||||
|
||||
class fcfs(Policy) :
|
||||
def __init__(self):
|
||||
pass;
|
||||
|
@ -27,6 +14,7 @@ class fcfs(Policy) :
|
|||
return -1
|
||||
|
||||
def sort_queue(self, event, queue):
|
||||
# How am I supposed to sort that mess??
|
||||
# FIXME
|
||||
return queue
|
||||
cmpf = lambda a, b: \
|
||||
a.get_schedulable().get_arrival_time() < \
|
||||
b.get_schedulable().get_arrival_time()
|
||||
self.sort(queue,cmpf)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue