- Added priority inversion issue and solution.
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1123 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
240eb23e85
commit
43bd4369ed
|
@ -201,6 +201,7 @@ src_backend_libbackend_la_SOURCES = \
|
|||
src/backend/resource_policy_lifo.cc \
|
||||
src/backend/resource_policy_manager.cc \
|
||||
src/backend/resource_policy_priority.cc \
|
||||
src/backend/resource_policy_priority_inheritance.cc \
|
||||
src/backend/schedulable.cc \
|
||||
src/backend/schedulable_statistics.cc \
|
||||
src/backend/scheduler.cc \
|
||||
|
@ -256,6 +257,7 @@ pkginclude_HEADERS += \
|
|||
src/backend/sgpemv2/resource_policy_lifo.hh \
|
||||
src/backend/sgpemv2/resource_policy_manager.hh \
|
||||
src/backend/sgpemv2/resource_policy_priority.hh \
|
||||
src/backend/sgpemv2/resource_policy_priority_inheritance.hh \
|
||||
src/backend/sgpemv2/process.hh \
|
||||
src/backend/sgpemv2/schedulable.hh \
|
||||
src/backend/sgpemv2/schedulable_statistics.hh \
|
||||
|
@ -588,7 +590,8 @@ examples_DATA = \
|
|||
src/testsuite/scheduling-wizards/environments/Matteo_preemption_fail.xgp \
|
||||
src/testsuite/scheduling-wizards/environments/Porno_priority_inversion.xgp \
|
||||
src/testsuite/scheduling-wizards/environments/ScuolaDiMileto_gap_fail.xgp \
|
||||
src/testsuite/scheduling-wizards/environments/DiscWorld_unblock.xgp
|
||||
src/testsuite/scheduling-wizards/environments/DiscWorld_unblock.xgp \
|
||||
src/testsuite/scheduling-wizards/environments/TheSecretOfMonkeyIsland.xgp
|
||||
|
||||
EXTRA_DIST += $(noinst_DATA) $(examples_DATA)
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <sgpemv2/resource_policy_lifo.hh>
|
||||
#include <sgpemv2/resource_policy_fifo.hh>
|
||||
#include <sgpemv2/resource_policy_priority.hh>
|
||||
#include <sgpemv2/resource_policy_priority_inheritance.hh>
|
||||
#include <sgpemv2/default_resource_policy_manager.hh>
|
||||
#include <sgpemv2/resource_policies_gatekeeper.hh>
|
||||
|
||||
|
@ -38,6 +39,7 @@ DefaultResourcePolicyManager::DefaultResourcePolicyManager()
|
|||
_policies.push_back(new ResourcePolicyLiFo());
|
||||
_policies.push_back(new ResourcePolicyFiFo());
|
||||
_policies.push_back(new ResourcePolicyPriority());
|
||||
_policies.push_back(new ResourcePolicyPriorityInheritance());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
#include <sgpemv2/resource_policy_priority.hh>
|
||||
#include <sgpemv2/thread.hh>
|
||||
|
||||
// FIXME: remove include
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace sgpem;
|
||||
|
@ -49,7 +47,6 @@ ResourcePolicyPriority::enforce(Environment& environment, Environment::SubReques
|
|||
{
|
||||
typedef Environment::SubRequestQueue SubRequestQueue;
|
||||
|
||||
// the last inserted request goes on the first free place.
|
||||
SubRequestQueue old_queue(queue);
|
||||
queue.clear();
|
||||
|
||||
|
@ -63,6 +60,7 @@ ResourcePolicyPriority::enforce(Environment& environment, Environment::SubReques
|
|||
|
||||
|
||||
|
||||
int pthis = sr.get_request().get_thread().get_current_priority();
|
||||
// assume they are ordered by priority.
|
||||
bool inserted = false;
|
||||
typedef SubRequestQueue::iterator It;
|
||||
|
@ -73,9 +71,6 @@ ResourcePolicyPriority::enforce(Environment& environment, Environment::SubReques
|
|||
{
|
||||
// non-allocated ones with lower priority go after the newly arrived
|
||||
int pthat = (**i).get_request().get_thread().get_current_priority();
|
||||
int pthis = sr.get_request().get_thread().get_current_priority();
|
||||
std::cout << "\npthat = " << pthat;
|
||||
std::cout << "\npthis = " << pthis;
|
||||
if(!inserted && pthis <= pthat)
|
||||
{
|
||||
queue.push_back(&sr);
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE sgpem SYSTEM "sgpem.dtd">
|
||||
<sgpem>
|
||||
<resources>
|
||||
<resource name="Raccoglibanane" id="reskey0" arrival-time="0" how-many="1" pre-emptible="false"/>
|
||||
</resources>
|
||||
<schedulables>
|
||||
<process name="Herman Toothrot" priority="0" arrival-time="3">
|
||||
<threads>
|
||||
<thread name="infastidisci" priority="6" arrival-delta="0" lasts-for="6">
|
||||
<requests/>
|
||||
</thread>
|
||||
</threads>
|
||||
</process>
|
||||
<process name="Guybrush Threepwood" priority="0" arrival-time="5">
|
||||
<threads>
|
||||
<thread name="salva Elaine" priority="3" arrival-delta="0" lasts-for="3">
|
||||
<requests>
|
||||
<request arrival-time="0">
|
||||
<subrequest resource="0" lasts-for="3"/>
|
||||
</request>
|
||||
</requests>
|
||||
</thread>
|
||||
</threads>
|
||||
</process>
|
||||
<process name="Lemonhead" priority="0" arrival-time="0">
|
||||
<threads>
|
||||
<thread name="mangia tofu" priority="9" arrival-delta="0" lasts-for="9">
|
||||
<requests>
|
||||
<request arrival-time="0">
|
||||
<subrequest resource="0" lasts-for="9"/>
|
||||
</request>
|
||||
</requests>
|
||||
</thread>
|
||||
</threads>
|
||||
</process>
|
||||
</schedulables>
|
||||
</sgpem>
|
Loading…
Reference in New Issue