Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::buffer_node< T, Allocator > Class Template Reference

Forwards messages in arbitrary order. More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::buffer_node< T, Allocator >:
Collaboration diagram for tbb::flow::interface11::buffer_node< T, Allocator >:

Classes

class  buffer_operation
 

Public Types

typedef T input_type
 
typedef T output_type
 
typedef receiver< input_type >::predecessor_type predecessor_type
 
typedef sender< output_type >::successor_type successor_type
 
typedef buffer_node< T, Allocator > class_type
 
- Public Types inherited from tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >
enum  buffer_item_state
 
typedef T item_type
 
- Public Types inherited from tbb::flow::interface11::internal::untyped_receiver
typedef untyped_sender predecessor_type
 The predecessor type for this node. More...
 
- Public Types inherited from tbb::flow::interface11::internal::untyped_sender
typedef untyped_receiver successor_type
 The successor type for this node. More...
 

Public Member Functions

 __TBB_STATIC_ASSERT ((tbb::internal::is_same_type< Allocator, null_type >::value), "Allocator template parameter for flow graph nodes is deprecated and will be removed. " "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface.")
 
__TBB_NOINLINE_SYM buffer_node (graph &g)
 Constructor. More...
 
__TBB_NOINLINE_SYM buffer_node (const buffer_node &src)
 Copy constructor. More...
 
bool register_successor (successor_type &r) __TBB_override
 Adds a new successor. More...
 
bool remove_successor (successor_type &r) __TBB_override
 Removes a successor. More...
 
bool try_get (T &v) __TBB_override
 Request an item from the buffer_node. More...
 
bool try_reserve (T &v) __TBB_override
 Reserves an item. More...
 
bool try_release () __TBB_override
 Release a reserved item. More...
 
bool try_consume () __TBB_override
 Consumes a reserved item. More...
 
- Public Member Functions inherited from tbb::flow::interface11::graph_node
 graph_node (graph &g)
 
virtual ~graph_node ()
 
- Public Member Functions inherited from tbb::flow::interface11::internal::reservable_item_buffer< T, cache_aligned_allocator< T > >
 reservable_item_buffer ()
 
void reset ()
 
- Public Member Functions inherited from tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >
 item_buffer ()
 Constructor. More...
 
 ~item_buffer ()
 
void reset ()
 
- Public Member Functions inherited from tbb::flow::interface11::receiver< T >
bool try_put (const typename internal::async_helpers< T >::filtered_type &t)
 Put an item to the receiver. More...
 
bool try_put (const typename internal::async_helpers< T >::async_type &t)
 
- Public Member Functions inherited from tbb::flow::interface11::internal::untyped_receiver
virtual ~untyped_receiver ()
 Destructor. More...
 
template<typename X >
bool try_put (const X &t)
 Put an item to the receiver. More...
 
virtual bool register_predecessor (predecessor_type &)
 Add a predecessor to the node. More...
 
virtual bool remove_predecessor (predecessor_type &)
 Remove a predecessor from the node. More...
 
- Public Member Functions inherited from tbb::flow::interface11::internal::untyped_sender
virtual ~untyped_sender ()
 

Protected Types

enum  op_type {
  reg_succ, rem_succ, req_item, res_item,
  rel_res, con_res, put_item, try_fwd_task
}
 
typedef size_t size_type
 
typedef internal::aggregating_functor< class_type, buffer_operationhandler_type
 
- Protected Types inherited from tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >
typedef size_t size_type
 
typedef aligned_pair< item_type, buffer_item_state >::type buffer_item_type
 
typedef tbb::internal::allocator_rebind< cache_aligned_allocator< T >, buffer_item_type >::type allocator_type
 

Protected Member Functions

virtual void handle_operations (buffer_operation *op_list)
 
template<typename derived_type >
void handle_operations_impl (buffer_operation *op_list, derived_type *derived)
 
taskgrab_forwarding_task (buffer_operation &op_data)
 
bool enqueue_forwarding_task (buffer_operation &op_data)
 
virtual taskforward_task ()
 This is executed by an enqueued task, the "forwarder". More...
 
virtual void internal_reg_succ (buffer_operation *op)
 Register successor. More...
 
virtual void internal_rem_succ (buffer_operation *op)
 Remove successor. More...
 
virtual void internal_forward_task (buffer_operation *op)
 Tries to forward valid items to successors. More...
 
template<typename derived_type >
void internal_forward_task_impl (buffer_operation *op, derived_type *derived)
 
virtual bool internal_push (buffer_operation *op)
 
virtual void internal_pop (buffer_operation *op)
 
virtual void internal_reserve (buffer_operation *op)
 
virtual void internal_consume (buffer_operation *op)
 
virtual void internal_release (buffer_operation *op)
 
tasktry_put_task (const T &t) __TBB_override
 receive an item, return a task *if possible More...
 
graphgraph_reference () const __TBB_override
 
void reset_receiver (reset_flags) __TBB_override
 put receiver back in initial state More...
 
void reset_node (reset_flags f) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::reservable_item_buffer< T, cache_aligned_allocator< T > >
bool reserve_front (T &v)
 
void consume_front ()
 
void release_front ()
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >
bool buffer_empty () const
 
buffer_item_typeitem (size_type i)
 
const buffer_item_typeitem (size_type i) const
 
bool my_item_valid (size_type i) const
 
bool my_item_reserved (size_type i) const
 
const item_typeget_my_item (size_t i) const
 
void set_my_item (size_t i, const item_type &o)
 
void fetch_item (size_t i, item_type &o)
 
void move_item (size_t to, size_t from)
 
bool place_item (size_t here, const item_type &me)
 
void swap_items (size_t i, size_t j)
 
void destroy_item (size_type i)
 
const item_typefront () const
 
const item_typeback () const
 
void reserve_item (size_type i)
 
void release_item (size_type i)
 
void destroy_front ()
 
void destroy_back ()
 
size_type size (size_t new_tail=0)
 
size_type capacity ()
 
bool buffer_full ()
 
void grow_my_array (size_t minimum_size)
 Grows the internal array. More...
 
bool push_back (item_type &v)
 
bool pop_back (item_type &v)
 
bool pop_front (item_type &v)
 
void clean_up_buffer (bool reset_pointers)
 
- Protected Member Functions inherited from tbb::flow::interface11::receiver< T >
virtual tasktry_put_task_wrapper (const void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_receiver
template<typename X >
tasktry_put_task (const X &t)
 
virtual bool is_continue_receiver ()
 
- Protected Member Functions inherited from tbb::flow::interface11::sender< T >
virtual bool try_get_wrapper (void *p, bool is_async) __TBB_override
 
virtual bool try_reserve_wrapper (void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_sender
template<typename X >
bool try_get (X &t)
 Request an item from the sender. More...
 
template<typename X >
bool try_reserve (X &t)
 Reserves an item in the sender. More...
 

Protected Attributes

internal::round_robin_cache< T, null_rw_mutexmy_successors
 
bool forwarder_busy
 
internal::aggregator< handler_type, buffer_operationmy_aggregator
 
- Protected Attributes inherited from tbb::flow::interface11::graph_node
graphmy_graph
 
graph_nodenext
 
graph_nodeprev
 
- Protected Attributes inherited from tbb::flow::interface11::internal::reservable_item_buffer< T, cache_aligned_allocator< T > >
bool my_reserved
 
- Protected Attributes inherited from tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >
buffer_item_typemy_array
 
size_type my_array_size
 
size_type my_head
 
size_type my_tail
 

Private Types

typedef cache_aligned_allocator< T > internals_allocator
 

Private Member Functions

void order ()
 
bool is_item_valid ()
 
void try_put_and_add_task (task *&last_task)
 

Friends

class internal::forward_task_bypass< class_type >
 
class internal::aggregating_functor< class_type, buffer_operation >
 
template<typename R , typename B >
class run_and_put_task
 
template<typename X , typename Y >
class internal::broadcast_cache
 
template<typename X , typename Y >
class internal::round_robin_cache
 

Additional Inherited Members

- Public Attributes inherited from tbb::flow::interface11::receiver< T >
__TBB_DEPRECATED typedef T input_type
 The input type of this receiver. More...
 
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
 
- Public Attributes inherited from tbb::flow::interface11::sender< T >
__TBB_DEPRECATED typedef T output_type
 The output type of this sender. More...
 
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
 
- Static Protected Attributes inherited from tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >
static const size_type initial_buffer_size
 

Detailed Description

template<typename T, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
class tbb::flow::interface11::buffer_node< T, Allocator >

Forwards messages in arbitrary order.

Definition at line 2044 of file flow_graph.h.

Member Typedef Documentation

◆ class_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef buffer_node<T, Allocator> tbb::flow::interface11::buffer_node< T, Allocator >::class_type

Definition at line 2062 of file flow_graph.h.

◆ handler_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef internal::aggregating_functor<class_type, buffer_operation> tbb::flow::interface11::buffer_node< T, Allocator >::handler_type
protected

Definition at line 2125 of file flow_graph.h.

◆ input_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef T tbb::flow::interface11::buffer_node< T, Allocator >::input_type

Definition at line 2058 of file flow_graph.h.

◆ internals_allocator

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef cache_aligned_allocator<T> tbb::flow::interface11::buffer_node< T, Allocator >::internals_allocator
private

Definition at line 2055 of file flow_graph.h.

◆ output_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef T tbb::flow::interface11::buffer_node< T, Allocator >::output_type

Definition at line 2059 of file flow_graph.h.

◆ predecessor_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef receiver<input_type>::predecessor_type tbb::flow::interface11::buffer_node< T, Allocator >::predecessor_type

Definition at line 2060 of file flow_graph.h.

◆ size_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef size_t tbb::flow::interface11::buffer_node< T, Allocator >::size_type
protected

Definition at line 2076 of file flow_graph.h.

◆ successor_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
typedef sender<output_type>::successor_type tbb::flow::interface11::buffer_node< T, Allocator >::successor_type

Definition at line 2061 of file flow_graph.h.

Member Enumeration Documentation

◆ op_type

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
enum tbb::flow::interface11::buffer_node::op_type
protected
Enumerator
reg_succ 
rem_succ 
req_item 
res_item 
rel_res 
con_res 
put_item 
try_fwd_task 

Definition at line 2085 of file flow_graph.h.

2086 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2087  , add_blt_succ, del_blt_succ,
2088  add_blt_pred, del_blt_pred,
2089  blt_succ_cnt, blt_pred_cnt,
2090  blt_succ_cpy, blt_pred_cpy // create vector copies of preds and succs
2091 #endif
2092  };

Constructor & Destructor Documentation

◆ buffer_node() [1/2]

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
__TBB_NOINLINE_SYM tbb::flow::interface11::buffer_node< T, Allocator >::buffer_node ( graph g)
inlineexplicit

Constructor.

Definition at line 2359 of file flow_graph.h.

2361  sender<T>(), forwarder_busy(false)
2362  {
2363  my_successors.set_owner(this);
2364  my_aggregator.initialize_handler(handler_type(this));
2365  tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_BUFFER_NODE, &this->my_graph,
2366  static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
2367  }
item_buffer with reservable front-end. NOTE: if reserving, do not
#define CODEPTR()
static void fgt_node(void *, string_index, void *, void *)
internal::aggregating_functor< class_type, buffer_operation > handler_type
Definition: flow_graph.h:2125
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2077
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127

References CODEPTR, tbb::internal::fgt_node(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::graph_node::my_graph, and tbb::flow::interface11::buffer_node< T, Allocator >::my_successors.

Here is the call graph for this function:

◆ buffer_node() [2/2]

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
__TBB_NOINLINE_SYM tbb::flow::interface11::buffer_node< T, Allocator >::buffer_node ( const buffer_node< T, Allocator > &  src)
inline

Copy constructor.

Definition at line 2377 of file flow_graph.h.

2379  receiver<T>(), sender<T>(), forwarder_busy(false)
2380  {
2381  my_successors.set_owner(this);
2382  my_aggregator.initialize_handler(handler_type(this));
2383  tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_BUFFER_NODE, &this->my_graph,
2384  static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
2385  }
item_buffer with reservable front-end. NOTE: if reserving, do not
#define CODEPTR()
static void fgt_node(void *, string_index, void *, void *)
internal::aggregating_functor< class_type, buffer_operation > handler_type
Definition: flow_graph.h:2125
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2077
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127

References CODEPTR, tbb::internal::fgt_node(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::graph_node::my_graph, and tbb::flow::interface11::buffer_node< T, Allocator >::my_successors.

Here is the call graph for this function:

Member Function Documentation

◆ __TBB_STATIC_ASSERT()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
tbb::flow::interface11::buffer_node< T, Allocator >::__TBB_STATIC_ASSERT ( (tbb::internal::is_same_type< Allocator, null_type >::value ,
"Allocator template parameter for flow graph nodes is deprecated and will be removed. " "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."   
)

◆ enqueue_forwarding_task()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task ( buffer_operation op_data)
inlineprotected

Definition at line 2186 of file flow_graph.h.

2186  {
2187  task *ft = grab_forwarding_task(op_data);
2188  if(ft) {
2190  return true;
2191  }
2192  return false;
2193  }
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:2538
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
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
task * grab_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:2182

References tbb::flow::interface11::buffer_node< T, Allocator >::grab_forwarding_task(), tbb::flow::interface11::buffer_node< T, Allocator >::graph_reference(), and tbb::flow::interface11::internal::spawn_in_graph_arena().

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::register_successor(), tbb::flow::interface11::buffer_node< T, Allocator >::remove_successor(), tbb::flow::interface11::buffer_node< T, Allocator >::try_consume(), tbb::flow::interface11::buffer_node< T, Allocator >::try_get(), tbb::flow::interface11::buffer_node< T, Allocator >::try_release(), and tbb::flow::interface11::buffer_node< T, Allocator >::try_reserve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_task()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual task* tbb::flow::interface11::buffer_node< T, Allocator >::forward_task ( )
inlineprotectedvirtual

This is executed by an enqueued task, the "forwarder".

Definition at line 2196 of file flow_graph.h.

2196  {
2197  buffer_operation op_data(try_fwd_task);
2198  task *last_task = NULL;
2199  do {
2200  op_data.status = internal::WAIT;
2201  op_data.ltask = NULL;
2202  my_aggregator.execute(&op_data);
2203 
2204  // workaround for icc bug
2205  tbb::task *xtask = op_data.ltask;
2206  graph& g = this->my_graph;
2207  last_task = combine_tasks(g, last_task, xtask);
2208  } while (op_data.status ==internal::SUCCEEDED);
2209  return last_task;
2210  }
Base class for user-defined tasks.
Definition: task.h:615
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
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:199

References tbb::flow::interface11::combine_tasks(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::ltask, tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::graph_node::my_graph, tbb::flow::interface11::internal::SUCCEEDED, tbb::flow::interface11::buffer_node< T, Allocator >::try_fwd_task, and tbb::flow::interface11::internal::WAIT.

Here is the call graph for this function:

◆ grab_forwarding_task()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
task* tbb::flow::interface11::buffer_node< T, Allocator >::grab_forwarding_task ( buffer_operation op_data)
inlineprotected

Definition at line 2182 of file flow_graph.h.

2182  {
2183  return op_data.ltask;
2184  }

References tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::ltask.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task(), and tbb::flow::interface11::buffer_node< T, Allocator >::try_put_task().

Here is the caller graph for this function:

◆ graph_reference()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
graph& tbb::flow::interface11::buffer_node< T, Allocator >::graph_reference ( ) const
inlineprotectedvirtual

◆ handle_operations()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual void tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations ( buffer_operation op_list)
inlineprotectedvirtual

Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >.

Definition at line 2129 of file flow_graph.h.

2129  {
2130  handle_operations_impl(op_list, this);
2131  }
void handle_operations_impl(buffer_operation *op_list, derived_type *derived)
Definition: flow_graph.h:2134

References tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:

◆ handle_operations_impl()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
template<typename derived_type >
void tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl ( buffer_operation op_list,
derived_type *  derived 
)
inlineprotected

Definition at line 2134 of file flow_graph.h.

2134  {
2135  __TBB_ASSERT(static_cast<class_type*>(derived) == this, "'this' is not a base class for derived");
2136 
2137  buffer_operation *tmp = NULL;
2138  bool try_forwarding = false;
2139  while (op_list) {
2140  tmp = op_list;
2141  op_list = op_list->next;
2142  switch (tmp->type) {
2143  case reg_succ: internal_reg_succ(tmp); try_forwarding = true; break;
2144  case rem_succ: internal_rem_succ(tmp); break;
2145  case req_item: internal_pop(tmp); break;
2146  case res_item: internal_reserve(tmp); break;
2147  case rel_res: internal_release(tmp); try_forwarding = true; break;
2148  case con_res: internal_consume(tmp); try_forwarding = true; break;
2149  case put_item: try_forwarding = internal_push(tmp); break;
2150  case try_fwd_task: internal_forward_task(tmp); break;
2151 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2152  // edge recording
2153  case add_blt_succ: internal_add_built_succ(tmp); break;
2154  case del_blt_succ: internal_del_built_succ(tmp); break;
2155  case add_blt_pred: internal_add_built_pred(tmp); break;
2156  case del_blt_pred: internal_del_built_pred(tmp); break;
2157  case blt_succ_cnt: internal_succ_cnt(tmp); break;
2158  case blt_pred_cnt: internal_pred_cnt(tmp); break;
2159  case blt_succ_cpy: internal_copy_succs(tmp); break;
2160  case blt_pred_cpy: internal_copy_preds(tmp); break;
2161 #endif
2162  }
2163  }
2164 
2165  derived->order();
2166 
2167  if (try_forwarding && !forwarder_busy) {
2168  if(internal::is_graph_active(this->my_graph)) {
2169  forwarder_busy = true;
2170  task *new_task = new(task::allocate_additional_child_of(*(this->my_graph.root_task()))) internal::
2171  forward_task_bypass<class_type>(*this);
2172  // tmp should point to the last item handled by the aggregator. This is the operation
2173  // the handling thread enqueued. So modifying that record will be okay.
2174  // workaround for icc bug
2175  tbb::task *z = tmp->ltask;
2176  graph &g = this->my_graph;
2177  tmp->ltask = combine_tasks(g, z, new_task); // in case the op generated a task
2178  }
2179  }
2180  } // handle_operations
virtual void internal_rem_succ(buffer_operation *op)
Remove successor.
Definition: flow_graph.h:2219
Base class for user-defined tasks.
Definition: task.h:615
virtual bool internal_push(buffer_operation *op)
Definition: flow_graph.h:2323
virtual void internal_forward_task(buffer_operation *op)
Tries to forward valid items to successors.
Definition: flow_graph.h:2294
virtual void internal_reg_succ(buffer_operation *op)
Register successor.
Definition: flow_graph.h:2213
bool is_graph_active(tbb::flow::interface10::graph &g)
virtual void internal_reserve(buffer_operation *op)
Definition: flow_graph.h:2338
virtual void internal_consume(buffer_operation *op)
Definition: flow_graph.h:2347
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
virtual void internal_pop(buffer_operation *op)
Definition: flow_graph.h:2329
__TBB_DEPRECATED tbb::task * root_task()
Returns the root task of the graph.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
virtual void internal_release(buffer_operation *op)
Definition: flow_graph.h:2352
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:199

References __TBB_ASSERT, tbb::flow::interface11::combine_tasks(), tbb::flow::interface11::buffer_node< T, Allocator >::con_res, tbb::flow::interface11::buffer_node< T, Allocator >::forwarder_busy, tbb::flow::interface11::buffer_node< T, Allocator >::internal_consume(), tbb::flow::interface11::buffer_node< T, Allocator >::internal_forward_task(), tbb::flow::interface11::buffer_node< T, Allocator >::internal_pop(), tbb::flow::interface11::buffer_node< T, Allocator >::internal_push(), tbb::flow::interface11::buffer_node< T, Allocator >::internal_reg_succ(), tbb::flow::interface11::buffer_node< T, Allocator >::internal_release(), tbb::flow::interface11::buffer_node< T, Allocator >::internal_rem_succ(), tbb::flow::interface11::buffer_node< T, Allocator >::internal_reserve(), tbb::flow::interface11::internal::is_graph_active(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::ltask, tbb::flow::interface11::graph_node::my_graph, tbb::flow::interface11::buffer_node< T, Allocator >::put_item, tbb::flow::interface11::buffer_node< T, Allocator >::reg_succ, tbb::flow::interface11::buffer_node< T, Allocator >::rel_res, tbb::flow::interface11::buffer_node< T, Allocator >::rem_succ, tbb::flow::interface11::buffer_node< T, Allocator >::req_item, tbb::flow::interface11::buffer_node< T, Allocator >::res_item, tbb::flow::interface10::graph::root_task(), tbb::flow::interface11::buffer_node< T, Allocator >::try_fwd_task, and tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::type.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations(), and tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::handle_operations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_consume()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual void tbb::flow::interface11::buffer_node< T, Allocator >::internal_consume ( buffer_operation op)
inlineprotectedvirtual

Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.

Definition at line 2347 of file flow_graph.h.

References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::internal::reservable_item_buffer< T, cache_aligned_allocator< T > >::consume_front(), and tbb::flow::interface11::internal::SUCCEEDED.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_forward_task()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual void tbb::flow::interface11::buffer_node< T, Allocator >::internal_forward_task ( buffer_operation op)
inlineprotectedvirtual

Tries to forward valid items to successors.

Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.

Definition at line 2294 of file flow_graph.h.

2294  {
2295  internal_forward_task_impl(op, this);
2296  }
void internal_forward_task_impl(buffer_operation *op, derived_type *derived)
Definition: flow_graph.h:2299

References tbb::flow::interface11::buffer_node< T, Allocator >::internal_forward_task_impl().

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_forward_task_impl()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
template<typename derived_type >
void tbb::flow::interface11::buffer_node< T, Allocator >::internal_forward_task_impl ( buffer_operation op,
derived_type *  derived 
)
inlineprotected

Definition at line 2299 of file flow_graph.h.

2299  {
2300  __TBB_ASSERT(static_cast<class_type*>(derived) == this, "'this' is not a base class for derived");
2301 
2302  if (this->my_reserved || !derived->is_item_valid()) {
2304  this->forwarder_busy = false;
2305  return;
2306  }
2307  // Try forwarding, giving each successor a chance
2308  task * last_task = NULL;
2309  size_type counter = my_successors.size();
2310  for (; counter > 0 && derived->is_item_valid(); --counter)
2311  derived->try_put_and_add_task(last_task);
2312 
2313  op->ltask = last_task; // return task
2314  if (last_task && !counter) {
2316  }
2317  else {
2319  forwarder_busy = false;
2320  }
2321  }
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:713
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2077
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
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

References __TBB_ASSERT, tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::internal::FAILED, tbb::flow::interface11::buffer_node< T, Allocator >::forwarder_busy, tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::ltask, tbb::flow::interface11::buffer_node< T, Allocator >::my_successors, and tbb::flow::interface11::internal::SUCCEEDED.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::internal_forward_task(), tbb::flow::interface11::queue_node< T, Allocator >::internal_forward_task(), and tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::internal_forward_task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_pop()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual void tbb::flow::interface11::buffer_node< T, Allocator >::internal_pop ( buffer_operation op)
inlineprotectedvirtual

Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.

Definition at line 2329 of file flow_graph.h.

2329  {
2330  if(this->pop_back(*(op->elem))) {
2332  }
2333  else {
2335  }
2336  }
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:713

References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::internal::FAILED, tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >::pop_back(), and tbb::flow::interface11::internal::SUCCEEDED.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_push()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual bool tbb::flow::interface11::buffer_node< T, Allocator >::internal_push ( buffer_operation op)
inlineprotectedvirtual

Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::sequencer_node< T, Allocator >.

Definition at line 2323 of file flow_graph.h.

2323  {
2324  this->push_back(*(op->elem));
2326  return true;
2327  }
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:713

References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >::push_back(), and tbb::flow::interface11::internal::SUCCEEDED.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_reg_succ()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual void tbb::flow::interface11::buffer_node< T, Allocator >::internal_reg_succ ( buffer_operation op)
inlineprotectedvirtual

Register successor.

Definition at line 2213 of file flow_graph.h.

2213  {
2214  my_successors.register_successor(*(op->r));
2216  }
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:713
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2077

References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::my_successors, tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::r, and tbb::flow::interface11::internal::SUCCEEDED.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_release()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual void tbb::flow::interface11::buffer_node< T, Allocator >::internal_release ( buffer_operation op)
inlineprotectedvirtual

Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >.

Definition at line 2352 of file flow_graph.h.

References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::internal::reservable_item_buffer< T, cache_aligned_allocator< T > >::release_front(), and tbb::flow::interface11::internal::SUCCEEDED.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_rem_succ()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual void tbb::flow::interface11::buffer_node< T, Allocator >::internal_rem_succ ( buffer_operation op)
inlineprotectedvirtual

Remove successor.

Definition at line 2219 of file flow_graph.h.

2219  {
2220  my_successors.remove_successor(*(op->r));
2222  }
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:713
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2077

References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::my_successors, tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::r, and tbb::flow::interface11::internal::SUCCEEDED.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_reserve()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
virtual void tbb::flow::interface11::buffer_node< T, Allocator >::internal_reserve ( buffer_operation op)
inlineprotectedvirtual

Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.

Definition at line 2338 of file flow_graph.h.

2338  {
2339  if(this->reserve_front(*(op->elem))) {
2341  }
2342  else {
2344  }
2345  }
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:713

References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::internal::FAILED, tbb::flow::interface11::internal::reservable_item_buffer< T, cache_aligned_allocator< T > >::reserve_front(), and tbb::flow::interface11::internal::SUCCEEDED.

Referenced by tbb::flow::interface11::buffer_node< T, Allocator >::handle_operations_impl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_item_valid()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::buffer_node< T, Allocator >::is_item_valid ( )
inlineprivate

Definition at line 2278 of file flow_graph.h.

References tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >::my_item_valid(), and tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >::my_tail.

Here is the call graph for this function:

◆ order()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::buffer_node< T, Allocator >::order ( )
inlineprivate

Definition at line 2276 of file flow_graph.h.

2276 {}

◆ register_successor()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::buffer_node< T, Allocator >::register_successor ( successor_type r)
inlinevirtual

Adds a new successor.

Adds successor r to the list of successors; may forward tasks.

Implements tbb::flow::interface11::internal::untyped_sender.

Definition at line 2399 of file flow_graph.h.

2399  {
2400  buffer_operation op_data(reg_succ);
2401  op_data.r = &r;
2402  my_aggregator.execute(&op_data);
2403  (void)enqueue_forwarding_task(op_data);
2404  return true;
2405  }
bool enqueue_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:2186
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127

References tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::r, tbb::flow::interface11::buffer_node< T, Allocator >::reg_succ, and void.

Here is the call graph for this function:

◆ remove_successor()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::buffer_node< T, Allocator >::remove_successor ( successor_type r)
inlinevirtual

Removes a successor.

Removes successor r from the list of successors. It also calls r.remove_predecessor(*this) to remove this node as a predecessor.

Implements tbb::flow::interface11::internal::untyped_sender.

Definition at line 2461 of file flow_graph.h.

2461  {
2462  r.remove_predecessor(*this);
2463  buffer_operation op_data(rem_succ);
2464  op_data.r = &r;
2465  my_aggregator.execute(&op_data);
2466  // even though this operation does not cause a forward, if we are the handler, and
2467  // a forward is scheduled, we may be the first to reach this point after the aggregator,
2468  // and so should check for the task.
2469  (void)enqueue_forwarding_task(op_data);
2470  return true;
2471  }
bool enqueue_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:2186
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127

References tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::r, tbb::flow::interface11::buffer_node< T, Allocator >::rem_succ, and void.

Here is the call graph for this function:

◆ reset_node()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::buffer_node< T, Allocator >::reset_node ( reset_flags  f)
inlineprotectedvirtual

Implements tbb::flow::interface11::graph_node.

Reimplemented in tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >, and tbb::flow::interface11::queue_node< T, Allocator >.

Definition at line 2553 of file flow_graph.h.

2553  {
2555  // TODO: just clear structures
2556  if (f&rf_clear_edges) {
2557  my_successors.clear();
2558 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2559  my_built_predecessors.clear();
2560 #endif
2561  }
2562  forwarder_busy = false;
2563  }
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2077

References tbb::flow::interface11::buffer_node< T, Allocator >::forwarder_busy, tbb::flow::interface11::buffer_node< T, Allocator >::my_successors, tbb::flow::interface11::internal::reservable_item_buffer< T, A >::reset(), and tbb::flow::interface11::rf_clear_edges.

Referenced by tbb::flow::interface11::queue_node< T, Allocator >::reset_node(), and tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::reset_node().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_receiver()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::buffer_node< T, Allocator >::reset_receiver ( reset_flags  f)
inlineprotectedvirtual

put receiver back in initial state

Implements tbb::flow::interface11::internal::untyped_receiver.

Definition at line 2542 of file flow_graph.h.

2542 { }

◆ try_consume()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::buffer_node< T, Allocator >::try_consume ( )
inlinevirtual

Consumes a reserved item.

true = item is removed from sender and reservation removed

Reimplemented from tbb::flow::interface11::internal::untyped_sender.

Definition at line 2506 of file flow_graph.h.

2506  {
2507  buffer_operation op_data(con_res);
2508  my_aggregator.execute(&op_data);
2509  (void)enqueue_forwarding_task(op_data);
2510  return true;
2511  }
bool enqueue_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:2186
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127

References tbb::flow::interface11::buffer_node< T, Allocator >::con_res, tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, and void.

Here is the call graph for this function:

◆ try_get()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::buffer_node< T, Allocator >::try_get ( T &  v)
inlinevirtual

Request an item from the buffer_node.

true = v contains the returned item
false = no item has been returned

Reimplemented from tbb::flow::interface11::sender< T >.

Definition at line 2476 of file flow_graph.h.

2476  {
2477  buffer_operation op_data(req_item);
2478  op_data.elem = &v;
2479  my_aggregator.execute(&op_data);
2480  (void)enqueue_forwarding_task(op_data);
2481  return (op_data.status==internal::SUCCEEDED);
2482  }
bool enqueue_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:2186
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127

References tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::buffer_node< T, Allocator >::req_item, tbb::flow::interface11::internal::SUCCEEDED, and void.

Here is the call graph for this function:

◆ try_put_and_add_task()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
void tbb::flow::interface11::buffer_node< T, Allocator >::try_put_and_add_task ( task *&  last_task)
inlineprivate

Definition at line 2282 of file flow_graph.h.

2282  {
2283  task *new_task = my_successors.try_put_task(this->back());
2284  if (new_task) {
2285  // workaround for icc bug
2286  graph& g = this->my_graph;
2287  last_task = combine_tasks(g, last_task, new_task);
2288  this->destroy_back();
2289  }
2290  }
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2077
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
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:199

References tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >::back(), tbb::flow::interface11::combine_tasks(), tbb::flow::interface11::internal::item_buffer< T, cache_aligned_allocator< T > >::destroy_back(), tbb::flow::interface11::graph_node::my_graph, and tbb::flow::interface11::buffer_node< T, Allocator >::my_successors.

Here is the call graph for this function:

◆ try_put_task()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
task* tbb::flow::interface11::buffer_node< T, Allocator >::try_put_task ( const T &  t)
inlineprotectedvirtual

receive an item, return a task *if possible

Implements tbb::flow::interface11::receiver< T >.

Definition at line 2519 of file flow_graph.h.

2519  {
2520  buffer_operation op_data(t, put_item);
2521  my_aggregator.execute(&op_data);
2522  task *ft = grab_forwarding_task(op_data);
2523  // sequencer_nodes can return failure (if an item has been previously inserted)
2524  // We have to spawn the returned task if our own operation fails.
2525 
2526  if(ft && op_data.status ==internal::FAILED) {
2527  // we haven't succeeded queueing the item, but for some reason the
2528  // call returned a task (if another request resulted in a successful
2529  // forward this could happen.) Queue the task and reset the pointer.
2531  }
2532  else if(!ft && op_data.status ==internal::SUCCEEDED) {
2533  ft = SUCCESSFULLY_ENQUEUED;
2534  }
2535  return ft;
2536  }
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:2538
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
static tbb::task *const SUCCESSFULLY_ENQUEUED
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
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127
task * grab_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:2182

References tbb::flow::interface11::internal::FAILED, tbb::flow::interface11::buffer_node< T, Allocator >::grab_forwarding_task(), tbb::flow::interface11::buffer_node< T, Allocator >::graph_reference(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::buffer_node< T, Allocator >::put_item, tbb::flow::interface11::internal::spawn_in_graph_arena(), tbb::flow::interface11::internal::SUCCEEDED, and tbb::flow::internal::SUCCESSFULLY_ENQUEUED.

Here is the call graph for this function:

◆ try_release()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::buffer_node< T, Allocator >::try_release ( )
inlinevirtual

Release a reserved item.

true = item has been released and so remains in sender

Reimplemented from tbb::flow::interface11::internal::untyped_sender.

Definition at line 2497 of file flow_graph.h.

2497  {
2498  buffer_operation op_data(rel_res);
2499  my_aggregator.execute(&op_data);
2500  (void)enqueue_forwarding_task(op_data);
2501  return true;
2502  }
bool enqueue_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:2186
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127

References tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::buffer_node< T, Allocator >::rel_res, and void.

Here is the call graph for this function:

◆ try_reserve()

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
bool tbb::flow::interface11::buffer_node< T, Allocator >::try_reserve ( T &  v)
inlinevirtual

Reserves an item.

false = no item can be reserved
true = an item is reserved

Reimplemented from tbb::flow::interface11::sender< T >.

Definition at line 2487 of file flow_graph.h.

2487  {
2488  buffer_operation op_data(res_item);
2489  op_data.elem = &v;
2490  my_aggregator.execute(&op_data);
2491  (void)enqueue_forwarding_task(op_data);
2492  return (op_data.status==internal::SUCCEEDED);
2493  }
bool enqueue_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:2186
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:2127

References tbb::flow::interface11::buffer_node< T, Allocator >::buffer_operation::elem, tbb::flow::interface11::buffer_node< T, Allocator >::enqueue_forwarding_task(), tbb::flow::interface11::buffer_node< T, Allocator >::my_aggregator, tbb::flow::interface11::buffer_node< T, Allocator >::res_item, tbb::flow::interface11::internal::SUCCEEDED, and void.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ internal::aggregating_functor< class_type, buffer_operation >

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
friend class internal::aggregating_functor< class_type, buffer_operation >
friend

Definition at line 2126 of file flow_graph.h.

◆ internal::broadcast_cache

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
template<typename X , typename Y >
friend class internal::broadcast_cache
friend

Definition at line 2516 of file flow_graph.h.

◆ internal::forward_task_bypass< class_type >

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
friend class internal::forward_task_bypass< class_type >
friend

Definition at line 2083 of file flow_graph.h.

◆ internal::round_robin_cache

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
template<typename X , typename Y >
friend class internal::round_robin_cache
friend

Definition at line 2517 of file flow_graph.h.

◆ run_and_put_task

template<typename T , typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
template<typename R , typename B >
friend class run_and_put_task
friend

Definition at line 2515 of file flow_graph.h.

Member Data Documentation

◆ forwarder_busy

◆ my_aggregator

◆ my_successors


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

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.