PFUNC
1.0
|
#include <pfunc/predicate.hpp>
Public Types | |
typedef task_traits< ValueType > ::attribute | attribute |
typedef task_traits< ValueType > ::functor | functor |
typedef compare_task_ptr < attribute, functor > | compare_type |
typedef bool | result_type |
typedef ValueType * | value_type |
Public Member Functions | |
group_predicate_pair (value_type previous_task) | |
bool | own_pred (value_type current_task) const |
bool | steal_pred (value_type current_task) const |
Public Attributes | |
value_type | previous_task |
compare_type | comp |
Define the group stealing predicate for the priority queue type. We have to ensure that we are stealing a task, which has at least the same priority as the one that we are waiting on. This prevents deadlocks from occuring.
typedef task_traits<ValueType>::attribute pfunc::detail::group_predicate_pair< prioS, ValueType >::attribute |
typedef compare_task_ptr<attribute, functor> pfunc::detail::group_predicate_pair< prioS, ValueType >::compare_type |
typedef task_traits<ValueType>::functor pfunc::detail::group_predicate_pair< prioS, ValueType >::functor |
typedef bool pfunc::detail::group_predicate_pair< prioS, ValueType >::result_type |
typedef ValueType* pfunc::detail::group_predicate_pair< prioS, ValueType >::value_type |
pfunc::detail::group_predicate_pair< prioS, ValueType >::group_predicate_pair | ( | value_type | previous_task | ) | [inline] |
Initialize the previous task.
bool pfunc::detail::group_predicate_pair< prioS, ValueType >::own_pred | ( | value_type | current_task | ) | const [inline] |
First, check that the task we are trying to pick is not in our group. Then pick the task only if it has lower priority than the task which we are waiting to complete.
[in] | current_task | Pointer to the task that is being chosen. |
bool pfunc::detail::group_predicate_pair< prioS, ValueType >::steal_pred | ( | value_type | current_task | ) | const [inline] |
Same as own_pred()
[in] | current_task | Pointer to the task that is being chosen. |
compare_type pfunc::detail::group_predicate_pair< prioS, ValueType >::comp |
value_type pfunc::detail::group_predicate_pair< prioS, ValueType >::previous_task |