internal::round_robin_cache< T, M > Class Template Reference

A cache of successors that are put in a round-robin fashion. More...

`#include <_flow_graph_cache_impl.h>`

Inheritance diagram for internal::round_robin_cache< T, M >:
Collaboration diagram for internal::round_robin_cache< T, M >:

## Public Member Functions

| round_robin_cache ()
size_type | size ()
task * | try_put_task (const T &t) __TBB_override
Public Member Functions inherited from internal::successor_cache< T, spin_rw_mutex >
| successor_cache ()
void | set_owner (owner_type *owner)
virtual | ~successor_cache ()
void | register_successor (successor_type &r)
void | remove_successor (successor_type &r)
bool | empty ()
void | clear ()

## Private Types

typedef size_t | size_type
typedef M | mutex_type
typedef successor_cache< T, M >::successors_type | successors_type

## Additional Inherited Members

Protected Types inherited from internal::successor_cache< T, spin_rw_mutex >
typedef spin_rw_mutex | mutex_type
typedef receiver< T > | successor_type
typedef receiver< T > * | pointer_type
typedef sender< T > | owner_type
typedef std::list< pointer_type > | successors_type
Protected Attributes inherited from internal::successor_cache< T, spin_rw_mutex >
mutex_type | my_mutex
successors_type | my_successors
owner_type * | my_owner

## Detailed Description

### template<typename T, typename M = spin_rw_mutex>
class internal::round_robin_cache< T, M >

A cache of successors that are put in a round-robin fashion.

Definition at line 546 of file _flow_graph_cache_impl.h.

## Member Typedef Documentation

## mutex_type

template<typename T , typename M = spin_rw_mutex>

typedef M internal::round_robin_cache< T, M >::mutex_type

private

Definition at line 548 of file _flow_graph_cache_impl.h.

## size_type

template<typename T , typename M = spin_rw_mutex>

typedef size_t internal::round_robin_cache< T, M >::size_type

private

Definition at line 547 of file _flow_graph_cache_impl.h.

## successors_type

template<typename T , typename M = spin_rw_mutex>

typedef successor_cache<T,M>::successors_type internal::round_robin_cache< T, M >::successors_type

private

Definition at line 549 of file _flow_graph_cache_impl.h.

## Constructor & Destructor Documentation

## round_robin_cache()

template<typename T , typename M = spin_rw_mutex>

internal::round_robin_cache< T, M >::round_robin_cache | ( |  | ) |

inline

Definition at line 553 of file _flow_graph_cache_impl.h.

{}

## Member Function Documentation

## size()

template<typename T , typename M = spin_rw_mutex>

size_type internal::round_robin_cache< T, M >::size | ( |  | ) |

inline

Definition at line 555 of file _flow_graph_cache_impl.h.

{
typename mutex_type::scoped_lock l(this->my_mutex, false);
return this->my_successors.size();
}
internal::successor_cache< T, spin_rw_mutex >::my_successors
successors_type my_successors
Definition: _flow_graph_cache_impl.h:292
internal::successor_cache< T, spin_rw_mutex >::my_mutex
mutex_type my_mutex
Definition: _flow_graph_cache_impl.h:277

## try_put_task()

template<typename T , typename M = spin_rw_mutex>

task* internal::round_robin_cache< T, M >::try_put_task | ( | const T & | t | ) |

inline virtual

Implements internal::successor_cache< T, spin_rw_mutex >.

Definition at line 564 of file _flow_graph_cache_impl.h.

{
#endif // __TBB_PREVIEW_ASYNC_MSG
bool upgraded = true;
typename mutex_type::scoped_lock l(this->my_mutex, upgraded);
typename successors_type::iterator i = this->my_successors.begin();
while ( i != this->my_successors.end() ) {
task *new_task = (*i)->try_put_task(t);
if ( new_task ) {
return new_task;
} else {
if ( (*i)->register_predecessor(*this->my_owner) ) {
if (!upgraded) {
l.upgrade_to_writer();
upgraded = true;
}
i = this->my_successors.erase(i);
}
else {
++i;
}
}
}
return NULL;
}
task
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task * task
Definition: ittnotify_static.h:119

References task.

The documentation for this class was generated from the following file:

- _flow_graph_cache_impl.h

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.