- 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:
tchernobog 2006-02-24 11:17:37 +00:00
parent 5dddd9b488
commit 7ce8cf93c3
5 changed files with 27 additions and 3 deletions

View file

@ -21,6 +21,7 @@
#include "python_policy.hh"
#include <limits>
#include <unistd.h>
#include <iostream>
using namespace sgpem;
using namespace std;
@ -134,7 +135,7 @@ PythonPolicy::is_pre_emptive() const throw(UserInterruptException)
// Parse return value stored in global Python object
retval = PyDict_GetItemString(_adapter_dict, "_ret_val");
return static_cast<bool>(PyInt_AsLong(retval));
return PyBool_Check(retval);
}

View file

@ -78,5 +78,6 @@ PythonPolicyManager::init()
// FIXME : Hardcoded policy name
char* policy_name = "fcfs";
//char* policy_name = "sjf";
_python_policy = std::auto_ptr<PythonPolicy>(new PythonPolicy(policy_name));
}