- 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
|
@ -23,11 +23,44 @@
|
|||
* here, thanks very much. */
|
||||
|
||||
#include "backend/pyloader/python_policy_manager.hh"
|
||||
#include "backend/process.hh"
|
||||
#include "backend/schedulable_status.hh"
|
||||
#include "backend/schedulable_list.hh"
|
||||
#include "backend/scheduler.hh"
|
||||
#include <cassert>
|
||||
|
||||
int
|
||||
main(int, char** ) {
|
||||
using namespace sgpem;
|
||||
|
||||
|
||||
// Create an INITIAL STATE
|
||||
Process p1("P1", 0,5,1);
|
||||
Process p2("P2", 0,5,2);
|
||||
Process p3("P3", 5,3,3);
|
||||
Process p4("P4", 6,2,3);
|
||||
Process p5("P5", 1,2,3);
|
||||
Process p6("P6", 10,2,1);
|
||||
|
||||
SchedulableStatus ss1(p1);
|
||||
SchedulableStatus ss2(p2);
|
||||
SchedulableStatus ss3(p3);
|
||||
SchedulableStatus ss4(p4);
|
||||
SchedulableStatus ss5(p5);
|
||||
SchedulableStatus ss6(p6);
|
||||
|
||||
SchedulableList initial;
|
||||
initial.add_at_bottom(ss1);
|
||||
initial.add_at_bottom(ss2);
|
||||
initial.add_at_bottom(ss3);
|
||||
initial.add_at_bottom(ss4);
|
||||
initial.add_at_bottom(ss5);
|
||||
initial.add_at_bottom(ss6);
|
||||
History::get_instance().enqueue_slice(initial);
|
||||
|
||||
PythonPolicyManager* ppm = PythonPolicyManager::get_instance();
|
||||
ppm->init();
|
||||
Policy& pol = ppm->get_policy();
|
||||
pol.configure();
|
||||
std::cout << pol.get_time_slice() << std::endl;
|
||||
pol.sort_queue(Scheduler::event_schedulable_arrival);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue