From c2e3e08ef2ce90237b7b50efd0adc1e2848a3729 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Thu, 17 May 2012 15:41:49 +0200 Subject: C++: Properly consider priority ceilings in DPCP bound The bound should not reflect requests executed by agents that can be preempted. --- native/src/sharedres.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'native/src/sharedres.cpp') diff --git a/native/src/sharedres.cpp b/native/src/sharedres.cpp index a91bfdf..5c8acee 100644 --- a/native/src/sharedres.cpp +++ b/native/src/sharedres.cpp @@ -225,6 +225,26 @@ void sort_by_request_length(ClusterResources& resources) apply_foreach(resources, sort_by_request_length); } +void determine_priority_ceilings(const Resources& resources, + PriorityCeilings& ceilings) +{ + ceilings.reserve(resources.size()); + + foreach(resources, it) + { + unsigned int ceiling = UINT_MAX; + const ContentionSet& cs = *it; + + foreach(cs, jt) + { + const RequestBound* req = *jt; + ceiling = std::min(ceiling, req->get_task()->get_priority()); + } + + ceilings.push_back(ceiling); + } +} + typedef std::vector ClusterContention; typedef std::vector TaskContention; -- cgit v1.2.2