_aggregator_impl.h   _aggregator_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 _concurrent_queue_impl.h   _concurrent_queue_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 _concurrent_unordered_impl.h   _concurrent_unordered_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 _flow_graph_impl.h   _flow_graph_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 142 skipping to change at line 142
} }
B get_body() { return body; } B get_body() { return body; }
/*override*/ function_body_leaf* clone() { /*override*/ function_body_leaf* clone() {
return new function_body_leaf< continue_msg, Output, B >(init_b ody); return new function_body_leaf< continue_msg, Output, B >(init_b ody);
} }
private: private:
B body; B body;
B init_body; B init_body;
}; };
# if TBB_PREVIEW_GRAPH_NODES
//! function_body that takes an Input and a set of output ports //! function_body that takes an Input and a set of output ports
template<typename Input, typename OutputSet> template<typename Input, typename OutputSet>
class multioutput_function_body { class multifunction_body {
public: public:
virtual ~multioutput_function_body () {} virtual ~multifunction_body () {}
virtual void operator()(const Input &/* input*/, OutputSet &/*oset* /) = 0; virtual void operator()(const Input &/* input*/, OutputSet &/*oset* /) = 0;
virtual multioutput_function_body* clone() = 0; virtual multifunction_body* clone() = 0;
}; };
//! leaf for multi-output function. OutputSet can be a std::tuple or a vector. //! leaf for multifunction. OutputSet can be a std::tuple or a vector.
template<typename Input, typename OutputSet, typename B> template<typename Input, typename OutputSet, typename B>
class multioutput_function_body_leaf : public multioutput_function_body <Input, OutputSet> { class multifunction_body_leaf : public multifunction_body<Input, Output Set> {
public: public:
multioutput_function_body_leaf(const B &_body) : body(_body), init_ body(_body) { } multifunction_body_leaf(const B &_body) : body(_body), init_body(_b ody) { }
void operator()(const Input &input, OutputSet &oset) { void operator()(const Input &input, OutputSet &oset) {
body(input, oset); // body should explicitly put() to one or mo re of oset. body(input, oset); // body should explicitly put() to one or mo re of oset.
} }
B get_body() { return body; } B get_body() { return body; }
/*override*/ multioutput_function_body_leaf* clone() { /*override*/ multifunction_body_leaf* clone() {
return new multioutput_function_body_leaf<Input, OutputSet,B>(i return new multifunction_body_leaf<Input, OutputSet,B>(init_bod
nit_body); y);
} }
private: private:
B body; B body;
B init_body; B init_body;
}; };
#endif // TBB_PREVIEW_GRAPH_NODES
//! A task that calls a node's forward function //! A task that calls a node's forward function
template< typename NodeType > template< typename NodeType >
class forward_task : public task { class forward_task : public task {
NodeType &my_node; NodeType &my_node;
public: public:
forward_task( NodeType &n ) : my_node(n) {} forward_task( NodeType &n ) : my_node(n) {}
 End of changes. 10 change blocks. 
12 lines changed or deleted 10 lines changed or added


 _flow_graph_item_buffer_impl.h   _flow_graph_item_buffer_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 _flow_graph_join_impl.h   _flow_graph_join_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 490 skipping to change at line 490
aggregator<my_handler, tag_matching_port_operation> my_aggregator; aggregator<my_handler, tag_matching_port_operation> my_aggregator;
void handle_operations(tag_matching_port_operation* op_list) { void handle_operations(tag_matching_port_operation* op_list) {
tag_matching_port_operation *current; tag_matching_port_operation *current;
while(op_list) { while(op_list) {
current = op_list; current = op_list;
op_list = op_list->next; op_list = op_list->next;
switch(current->type) { switch(current->type) {
case try__put: { case try__put: {
bool was_inserted = this->tagged_insert(current->my _tag_value, current->my_val); bool was_inserted = this->tagged_insert(current->my _tag_value, current->my_val);
if(!was_inserted) __TBB_ASSERT( false, "multiple in // return failure if a duplicate insertion occurs
sertions of same tag"); __TBB_store_with_release(current->status, was_inser
__TBB_store_with_release(current->status, SUCCEEDED ted ? SUCCEEDED : FAILED);
);
} }
break; break;
case get__item: case get__item:
// use current_tag from FE for item // use current_tag from FE for item
if(!this->tagged_find(my_join->current_tag, *(current-> my_arg))) { if(!this->tagged_find(my_join->current_tag, *(current-> my_arg))) {
__TBB_ASSERT(false, "Failed to find item correspond ing to current_tag."); __TBB_ASSERT(false, "Failed to find item correspond ing to current_tag.");
} }
__TBB_store_with_release(current->status, SUCCEEDED); __TBB_store_with_release(current->status, SUCCEEDED);
break; break;
case res_port: case res_port:
skipping to change at line 627 skipping to change at line 627
} }
// if all input_ports have predecessors, spawn forward to try and c onsume tuples // if all input_ports have predecessors, spawn forward to try and c onsume tuples
void decrement_port_count() { void decrement_port_count() {
if(ports_with_no_inputs.fetch_and_decrement() == 1) { if(ports_with_no_inputs.fetch_and_decrement() == 1) {
task::enqueue( * new ( task::allocate_additional_child_of( *(this->my_root_task) ) ) task::enqueue( * new ( task::allocate_additional_child_of( *(this->my_root_task) ) )
forward_task<my_node_type>(*my_node) ); forward_task<my_node_type>(*my_node) );
} }
} }
input_type &inputs() { return my_inputs; } input_type &input_ports() { return my_inputs; }
protected: protected:
// all methods on input ports should be called under mutual exclusi on from join_node_base. // all methods on input ports should be called under mutual exclusi on from join_node_base.
bool tuple_build_may_succeed() { bool tuple_build_may_succeed() {
return !ports_with_no_inputs; return !ports_with_no_inputs;
} }
bool try_to_make_tuple(output_type &out) { bool try_to_make_tuple(output_type &out) {
if(ports_with_no_inputs) return false; if(ports_with_no_inputs) return false;
return join_helper<N>::reserve(my_inputs, out); return join_helper<N>::reserve(my_inputs, out);
skipping to change at line 687 skipping to change at line 687
// if all input_ports have items, spawn forward to try and consume tuples // if all input_ports have items, spawn forward to try and consume tuples
void decrement_port_count() { void decrement_port_count() {
if(ports_with_no_items.fetch_and_decrement() == 1) { if(ports_with_no_items.fetch_and_decrement() == 1) {
task::enqueue( * new ( task::allocate_additional_child_of( *(this->my_root_task) ) ) task::enqueue( * new ( task::allocate_additional_child_of( *(this->my_root_task) ) )
forward_task<my_node_type>(*my_node) ); forward_task<my_node_type>(*my_node) );
} }
} }
void increment_port_count() { __TBB_ASSERT(false, NULL); } // shou ld never be called void increment_port_count() { __TBB_ASSERT(false, NULL); } // shou ld never be called
input_type &inputs() { return my_inputs; } input_type &input_ports() { return my_inputs; }
protected: protected:
// all methods on input ports should be called under mutual exclusi on from join_node_base. // all methods on input ports should be called under mutual exclusi on from join_node_base.
bool tuple_build_may_succeed() { bool tuple_build_may_succeed() {
return !ports_with_no_items; return !ports_with_no_items;
} }
bool try_to_make_tuple(output_type &out) { bool try_to_make_tuple(output_type &out) {
if(ports_with_no_items) return false; if(ports_with_no_items) return false;
return join_helper<N>::get_items(my_inputs, out); return join_helper<N>::get_items(my_inputs, out);
skipping to change at line 862 skipping to change at line 862
void increment_tag_count(tag_value t) { // called from input_ports void increment_tag_count(tag_value t) { // called from input_ports
tag_matching_FE_operation op_data(t, inc_count); tag_matching_FE_operation op_data(t, inc_count);
my_aggregator.execute(&op_data); my_aggregator.execute(&op_data);
return; return;
} }
void decrement_port_count() { __TBB_ASSERT(false, NULL); } void decrement_port_count() { __TBB_ASSERT(false, NULL); }
void increment_port_count() { __TBB_ASSERT(false, NULL); } // shou ld never be called void increment_port_count() { __TBB_ASSERT(false, NULL); } // shou ld never be called
input_type &inputs() { return my_inputs; } input_type &input_ports() { return my_inputs; }
protected: protected:
// all methods on input ports should be called under mutual exclusi on from join_node_base. // all methods on input ports should be called under mutual exclusi on from join_node_base.
bool tuple_build_may_succeed() { // called from back-end bool tuple_build_may_succeed() { // called from back-end
tag_matching_FE_operation op_data(may_succeed); tag_matching_FE_operation op_data(may_succeed);
my_aggregator.execute(&op_data); my_aggregator.execute(&op_data);
return op_data.status == SUCCEEDED; return op_data.status == SUCCEEDED;
} }
// cannot lock while calling back to input_ports. current_tag will only be set // cannot lock while calling back to input_ports. current_tag will only be set
skipping to change at line 896 skipping to change at line 896
} }
input_type my_inputs; // input ports input_type my_inputs; // input ports
my_node_type *my_node; my_node_type *my_node;
}; // join_node_FE<tag_matching, InputTuple, OutputTuple> }; // join_node_FE<tag_matching, InputTuple, OutputTuple>
//! join_node_base //! join_node_base
template<graph_buffer_policy JP, typename InputTuple, typename OutputTu ple> template<graph_buffer_policy JP, typename InputTuple, typename OutputTu ple>
class join_node_base : public graph_node, public join_node_FE<JP, Input Tuple, OutputTuple>, class join_node_base : public graph_node, public join_node_FE<JP, Input Tuple, OutputTuple>,
public sender<OutputTuple> { public sender<OutputTuple> {
using graph_node::my_graph;
public: public:
typedef OutputTuple output_type; typedef OutputTuple output_type;
typedef receiver<output_type> successor_type; typedef receiver<output_type> successor_type;
typedef join_node_FE<JP, InputTuple, OutputTuple> input_ports_type; typedef join_node_FE<JP, InputTuple, OutputTuple> input_ports_type;
using input_ports_type::tuple_build_may_succeed; using input_ports_type::tuple_build_may_succeed;
using input_ports_type::try_to_make_tuple; using input_ports_type::try_to_make_tuple;
using input_ports_type::tuple_accepted; using input_ports_type::tuple_accepted;
using input_ports_type::tuple_rejected; using input_ports_type::tuple_rejected;
skipping to change at line 986 skipping to change at line 987
} }
__TBB_store_with_release(current->status, SUCCEEDED ); __TBB_store_with_release(current->status, SUCCEEDED );
forwarder_busy = false; forwarder_busy = false;
} }
break; break;
} }
} }
} }
// ---------- end aggregator ----------- // ---------- end aggregator -----------
public: public:
join_node_base(graph &g) : input_ports_type(g), forwarder_busy(fals e) { join_node_base(graph &g) : graph_node(g), input_ports_type(g), forw arder_busy(false) {
my_successors.set_owner(this); my_successors.set_owner(this);
input_ports_type::set_my_node(this); input_ports_type::set_my_node(this);
my_aggregator.initialize_handler(my_handler(this)); my_aggregator.initialize_handler(my_handler(this));
} }
join_node_base(const join_node_base& other) : join_node_base(const join_node_base& other) :
graph_node(), input_ports_type(other), graph_node(other.my_graph), input_ports_type(other),
sender<OutputTuple>(), forwarder_busy(false), my_successors() { sender<OutputTuple>(), forwarder_busy(false), my_successors() {
my_successors.set_owner(this); my_successors.set_owner(this);
input_ports_type::set_my_node(this); input_ports_type::set_my_node(this);
my_aggregator.initialize_handler(my_handler(this)); my_aggregator.initialize_handler(my_handler(this));
} }
template<typename FunctionTuple> template<typename FunctionTuple>
join_node_base(graph &g, FunctionTuple f) : input_ports_type(g, f), forwarder_busy(false) { join_node_base(graph &g, FunctionTuple f) : graph_node(g), input_po rts_type(g, f), forwarder_busy(false) {
my_successors.set_owner(this); my_successors.set_owner(this);
input_ports_type::set_my_node(this); input_ports_type::set_my_node(this);
my_aggregator.initialize_handler(my_handler(this)); my_aggregator.initialize_handler(my_handler(this));
} }
bool register_successor(successor_type &r) { bool register_successor(successor_type &r) {
join_node_base_operation op_data(r, reg_succ); join_node_base_operation op_data(r, reg_succ);
my_aggregator.execute(&op_data); my_aggregator.execute(&op_data);
return op_data.status == SUCCEEDED; return op_data.status == SUCCEEDED;
} }
skipping to change at line 1036 skipping to change at line 1037
broadcast_cache<output_type, null_rw_mutex> my_successors; broadcast_cache<output_type, null_rw_mutex> my_successors;
friend class forward_task< join_node_base<JP, InputTuple, OutputTup le> >; friend class forward_task< join_node_base<JP, InputTuple, OutputTup le> >;
void forward() { void forward() {
join_node_base_operation op_data(do_fwrd); join_node_base_operation op_data(do_fwrd);
my_aggregator.execute(&op_data); my_aggregator.execute(&op_data);
} }
}; };
//! unfolded_join_node : passes input_ports_tuple_type to join_node_bas e. We build the input port type //! unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type
// using tuple_element. The class PT is the port type (reserving_port , queueing_port, tag_matching_port) // using tuple_element. The class PT is the port type (reserving_port , queueing_port, tag_matching_port)
// and should match the graph_buffer_policy. // and should match the graph_buffer_policy.
template<int N, template<class> class PT, typename OutputTuple, graph_b uffer_policy JP> template<int N, template<class> class PT, typename OutputTuple, graph_b uffer_policy JP>
class unfolded_join_node; class unfolded_join_node;
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<2,PT,OutputTuple,JP> : public internal::join_n ode_base<JP, class unfolded_join_node<2,PT,OutputTuple,JP> : public internal::join_n ode_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type> >, PT<typename std::tuple_element<1,OutputTuple>::type> >,
OutputTuple OutputTuple
> >
{ {
public: public:
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<1,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<3,PT,OutputTuple,JP> : public internal::join_n ode_base<JP, class unfolded_join_node<3,PT,OutputTuple,JP> : public internal::join_n ode_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type> >, PT<typename std::tuple_element<2,OutputTuple>::type> >,
OutputTuple OutputTuple
> >
{ {
public: public:
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<2,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<4,PT,OutputTuple,JP> : public internal::join_n ode_base<JP, class unfolded_join_node<4,PT,OutputTuple,JP> : public internal::join_n ode_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type>, PT<typename std::tuple_element<2,OutputTuple>::type>,
PT<typename std::tuple_element<3,OutputTuple>::type> >, PT<typename std::tuple_element<3,OutputTuple>::type> >,
OutputTuple OutputTuple
> { > {
public: public:
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type>, PT<typename std::tuple_element<2,OutputTuple>::type>,
PT<typename std::tuple_element<3,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<3,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<5,PT,OutputTuple,JP> : public internal::join_n ode_base<JP, class unfolded_join_node<5,PT,OutputTuple,JP> : public internal::join_n ode_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
skipping to change at line 1123 skipping to change at line 1124
PT<typename std::tuple_element<3,OutputTuple>::type>, PT<typename std::tuple_element<3,OutputTuple>::type>,
PT<typename std::tuple_element<4,OutputTuple>::type> >, PT<typename std::tuple_element<4,OutputTuple>::type> >,
OutputTuple OutputTuple
> { > {
public: public:
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type>, PT<typename std::tuple_element<2,OutputTuple>::type>,
PT<typename std::tuple_element<3,OutputTuple>::type>, PT<typename std::tuple_element<3,OutputTuple>::type>,
PT<typename std::tuple_element<4,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<4,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<6,PT,OutputTuple,JP> : public internal::join_n ode_base<JP, class unfolded_join_node<6,PT,OutputTuple,JP> : public internal::join_n ode_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
skipping to change at line 1150 skipping to change at line 1151
PT<typename std::tuple_element<5,OutputTuple>::type> >, PT<typename std::tuple_element<5,OutputTuple>::type> >,
OutputTuple OutputTuple
> { > {
public: public:
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type>, PT<typename std::tuple_element<2,OutputTuple>::type>,
PT<typename std::tuple_element<3,OutputTuple>::type>, PT<typename std::tuple_element<3,OutputTuple>::type>,
PT<typename std::tuple_element<4,OutputTuple>::type>, PT<typename std::tuple_element<4,OutputTuple>::type>,
PT<typename std::tuple_element<5,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<5,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<7,PT,OutputTuple,JP> : public internal::join_n ode_base<JP, class unfolded_join_node<7,PT,OutputTuple,JP> : public internal::join_n ode_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
skipping to change at line 1179 skipping to change at line 1180
OutputTuple OutputTuple
> { > {
public: public:
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type>, PT<typename std::tuple_element<2,OutputTuple>::type>,
PT<typename std::tuple_element<3,OutputTuple>::type>, PT<typename std::tuple_element<3,OutputTuple>::type>,
PT<typename std::tuple_element<4,OutputTuple>::type>, PT<typename std::tuple_element<4,OutputTuple>::type>,
PT<typename std::tuple_element<5,OutputTuple>::type>, PT<typename std::tuple_element<5,OutputTuple>::type>,
PT<typename std::tuple_element<6,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<6,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<8,PT,OutputTuple,JP> : public internal::join_n ode_base<JP, class unfolded_join_node<8,PT,OutputTuple,JP> : public internal::join_n ode_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
skipping to change at line 1210 skipping to change at line 1211
> { > {
public: public:
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type>, PT<typename std::tuple_element<2,OutputTuple>::type>,
PT<typename std::tuple_element<3,OutputTuple>::type>, PT<typename std::tuple_element<3,OutputTuple>::type>,
PT<typename std::tuple_element<4,OutputTuple>::type>, PT<typename std::tuple_element<4,OutputTuple>::type>,
PT<typename std::tuple_element<5,OutputTuple>::type>, PT<typename std::tuple_element<5,OutputTuple>::type>,
PT<typename std::tuple_element<6,OutputTuple>::type>, PT<typename std::tuple_element<6,OutputTuple>::type>,
PT<typename std::tuple_element<7,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<7,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<9,PT,OutputTuple,JP> : public internal::join_n ode_base<JP, class unfolded_join_node<9,PT,OutputTuple,JP> : public internal::join_n ode_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
skipping to change at line 1243 skipping to change at line 1244
public: public:
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type>, PT<typename std::tuple_element<2,OutputTuple>::type>,
PT<typename std::tuple_element<3,OutputTuple>::type>, PT<typename std::tuple_element<3,OutputTuple>::type>,
PT<typename std::tuple_element<4,OutputTuple>::type>, PT<typename std::tuple_element<4,OutputTuple>::type>,
PT<typename std::tuple_element<5,OutputTuple>::type>, PT<typename std::tuple_element<5,OutputTuple>::type>,
PT<typename std::tuple_element<6,OutputTuple>::type>, PT<typename std::tuple_element<6,OutputTuple>::type>,
PT<typename std::tuple_element<7,OutputTuple>::type>, PT<typename std::tuple_element<7,OutputTuple>::type>,
PT<typename std::tuple_element<8,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<8,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP> template<template<class> class PT, typename OutputTuple, graph_buffer_p olicy JP>
class unfolded_join_node<10,PT,OutputTuple,JP> : public internal::join_ node_base<JP, class unfolded_join_node<10,PT,OutputTuple,JP> : public internal::join_ node_base<JP,
std::tuple< std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
skipping to change at line 1278 skipping to change at line 1279
typedef typename std::tuple< typedef typename std::tuple<
PT<typename std::tuple_element<0,OutputTuple>::type>, PT<typename std::tuple_element<0,OutputTuple>::type>,
PT<typename std::tuple_element<1,OutputTuple>::type>, PT<typename std::tuple_element<1,OutputTuple>::type>,
PT<typename std::tuple_element<2,OutputTuple>::type>, PT<typename std::tuple_element<2,OutputTuple>::type>,
PT<typename std::tuple_element<3,OutputTuple>::type>, PT<typename std::tuple_element<3,OutputTuple>::type>,
PT<typename std::tuple_element<4,OutputTuple>::type>, PT<typename std::tuple_element<4,OutputTuple>::type>,
PT<typename std::tuple_element<5,OutputTuple>::type>, PT<typename std::tuple_element<5,OutputTuple>::type>,
PT<typename std::tuple_element<6,OutputTuple>::type>, PT<typename std::tuple_element<6,OutputTuple>::type>,
PT<typename std::tuple_element<7,OutputTuple>::type>, PT<typename std::tuple_element<7,OutputTuple>::type>,
PT<typename std::tuple_element<8,OutputTuple>::type>, PT<typename std::tuple_element<8,OutputTuple>::type>,
PT<typename std::tuple_element<9,OutputTuple>::type> > inpu t_ports_tuple_type; PT<typename std::tuple_element<9,OutputTuple>::type> > inpu t_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<JP, input_ports_tuple_type, output_type > ba se_type; typedef join_node_base<JP, input_ports_type, output_type > base_typ e;
public: public:
unfolded_join_node(graph &g) : base_type(g) {} unfolded_join_node(graph &g) : base_type(g) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
// tag_matching unfolded_join_node. This must be a separate specializa tion because the constructors // tag_matching unfolded_join_node. This must be a separate specializa tion because the constructors
// differ. // differ.
template<typename OutputTuple> template<typename OutputTuple>
class unfolded_join_node<2,tag_matching_port,OutputTuple,tag_matching> : public internal::join_node_base<tag_matching, class unfolded_join_node<2,tag_matching_port,OutputTuple,tag_matching> : public internal::join_node_base<tag_matching,
std::tuple< std::tuple<
tag_matching_port<typename std::tuple_element<0,OutputTuple >::type>, tag_matching_port<typename std::tuple_element<0,OutputTuple >::type>,
tag_matching_port<typename std::tuple_element<1,OutputTuple >::type> >, tag_matching_port<typename std::tuple_element<1,OutputTuple >::type> >,
OutputTuple OutputTuple
> >
{ {
typedef typename std::tuple_element<0, OutputTuple>::type T0; typedef typename std::tuple_element<0, OutputTuple>::type T0;
typedef typename std::tuple_element<1, OutputTuple>::type T1; typedef typename std::tuple_element<1, OutputTuple>::type T1;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1> > input_ports_tuple_type; typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1> > input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename std::tuple< f0_p, f1_p > func_initializer_type; typedef typename std::tuple< f0_p, f1_p > func_initializer_type;
public: public:
template<typename B0, typename B1> template<typename B0, typename B1>
unfolded_join_node(graph &g, B0 b0, B1 b1) : base_type(g, unfolded_join_node(graph &g, B0 b0, B1 b1) : base_type(g,
func_initializer_type( func_initializer_type(
new internal::function_body_leaf<T0, tag_value, B0>(b0) , new internal::function_body_leaf<T0, tag_value, B0>(b0) ,
new internal::function_body_leaf<T1, tag_value, B1>(b1) new internal::function_body_leaf<T1, tag_value, B1>(b1)
) ) {} ) ) {}
skipping to change at line 1332 skipping to change at line 1333
tag_matching_port<typename std::tuple_element<1,OutputTuple >::type>, tag_matching_port<typename std::tuple_element<1,OutputTuple >::type>,
tag_matching_port<typename std::tuple_element<2,OutputTuple >::type> >, tag_matching_port<typename std::tuple_element<2,OutputTuple >::type> >,
OutputTuple OutputTuple
> >
{ {
typedef typename std::tuple_element<0, OutputTuple>::type T0; typedef typename std::tuple_element<0, OutputTuple>::type T0;
typedef typename std::tuple_element<1, OutputTuple>::type T1; typedef typename std::tuple_element<1, OutputTuple>::type T1;
typedef typename std::tuple_element<2, OutputTuple>::type T2; typedef typename std::tuple_element<2, OutputTuple>::type T2;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2> typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>
> input_ports_tuple_type; > input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename std::tuple< f0_p, f1_p, f2_p > func_initializer_ty pe; typedef typename std::tuple< f0_p, f1_p, f2_p > func_initializer_ty pe;
public: public:
template<typename B0, typename B1, typename B2> template<typename B0, typename B1, typename B2>
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2) : base_type(g, unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2) : base_type(g,
func_initializer_type( func_initializer_type(
new internal::function_body_leaf<T0, tag_value, B0>(b0) , new internal::function_body_leaf<T0, tag_value, B0>(b0) ,
new internal::function_body_leaf<T1, tag_value, B1>(b1) , new internal::function_body_leaf<T1, tag_value, B1>(b1) ,
skipping to change at line 1366 skipping to change at line 1367
tag_matching_port<typename std::tuple_element<2,OutputTuple >::type>, tag_matching_port<typename std::tuple_element<2,OutputTuple >::type>,
tag_matching_port<typename std::tuple_element<3,OutputTuple >::type> tag_matching_port<typename std::tuple_element<3,OutputTuple >::type>
>, OutputTuple > >, OutputTuple >
{ {
typedef typename std::tuple_element<0, OutputTuple>::type T0; typedef typename std::tuple_element<0, OutputTuple>::type T0;
typedef typename std::tuple_element<1, OutputTuple>::type T1; typedef typename std::tuple_element<1, OutputTuple>::type T1;
typedef typename std::tuple_element<2, OutputTuple>::type T2; typedef typename std::tuple_element<2, OutputTuple>::type T2;
typedef typename std::tuple_element<3, OutputTuple>::type T3; typedef typename std::tuple_element<3, OutputTuple>::type T3;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>, typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>,
tag_matching_port<T3> > input_ports_tuple_type; tag_matching_port<T3> > input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p > func_initiali zer_type; typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p > func_initiali zer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3> template<typename B0, typename B1, typename B2, typename B3>
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3) : base_typ e(g, unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3) : base_typ e(g,
func_initializer_type( func_initializer_type(
new internal::function_body_leaf<T0, tag_value, B0>(b0) , new internal::function_body_leaf<T0, tag_value, B0>(b0) ,
skipping to change at line 1404 skipping to change at line 1405
tag_matching_port<typename std::tuple_element<4,OutputTuple >::type> tag_matching_port<typename std::tuple_element<4,OutputTuple >::type>
>, OutputTuple > >, OutputTuple >
{ {
typedef typename std::tuple_element<0, OutputTuple>::type T0; typedef typename std::tuple_element<0, OutputTuple>::type T0;
typedef typename std::tuple_element<1, OutputTuple>::type T1; typedef typename std::tuple_element<1, OutputTuple>::type T1;
typedef typename std::tuple_element<2, OutputTuple>::type T2; typedef typename std::tuple_element<2, OutputTuple>::type T2;
typedef typename std::tuple_element<3, OutputTuple>::type T3; typedef typename std::tuple_element<3, OutputTuple>::type T3;
typedef typename std::tuple_element<4, OutputTuple>::type T4; typedef typename std::tuple_element<4, OutputTuple>::type T4;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>, typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>,
tag_matching_port<T3>, tag_matching_port<T4> > input_ports_ tuple_type; tag_matching_port<T3>, tag_matching_port<T4> > input_ports_ type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p > func_in itializer_type; typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p > func_in itializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena me B4> template<typename B0, typename B1, typename B2, typename B3, typena me B4>
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4) : b ase_type(g, unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4) : b ase_type(g,
func_initializer_type( func_initializer_type(
skipping to change at line 1446 skipping to change at line 1447
>, OutputTuple > >, OutputTuple >
{ {
typedef typename std::tuple_element<0, OutputTuple>::type T0; typedef typename std::tuple_element<0, OutputTuple>::type T0;
typedef typename std::tuple_element<1, OutputTuple>::type T1; typedef typename std::tuple_element<1, OutputTuple>::type T1;
typedef typename std::tuple_element<2, OutputTuple>::type T2; typedef typename std::tuple_element<2, OutputTuple>::type T2;
typedef typename std::tuple_element<3, OutputTuple>::type T3; typedef typename std::tuple_element<3, OutputTuple>::type T3;
typedef typename std::tuple_element<4, OutputTuple>::type T4; typedef typename std::tuple_element<4, OutputTuple>::type T4;
typedef typename std::tuple_element<5, OutputTuple>::type T5; typedef typename std::tuple_element<5, OutputTuple>::type T5;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>, typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>,
tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5> > input_ports_tuple_type; tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5> > input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5_p > f unc_initializer_type; typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5_p > f unc_initializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena me B4, typename B5> template<typename B0, typename B1, typename B2, typename B3, typena me B4, typename B5>
unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 b5) : base_type(g, unfolded_join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 b5) : base_type(g,
skipping to change at line 1493 skipping to change at line 1494
typedef typename std::tuple_element<0, OutputTuple>::type T0; typedef typename std::tuple_element<0, OutputTuple>::type T0;
typedef typename std::tuple_element<1, OutputTuple>::type T1; typedef typename std::tuple_element<1, OutputTuple>::type T1;
typedef typename std::tuple_element<2, OutputTuple>::type T2; typedef typename std::tuple_element<2, OutputTuple>::type T2;
typedef typename std::tuple_element<3, OutputTuple>::type T3; typedef typename std::tuple_element<3, OutputTuple>::type T3;
typedef typename std::tuple_element<4, OutputTuple>::type T4; typedef typename std::tuple_element<4, OutputTuple>::type T4;
typedef typename std::tuple_element<5, OutputTuple>::type T5; typedef typename std::tuple_element<5, OutputTuple>::type T5;
typedef typename std::tuple_element<6, OutputTuple>::type T6; typedef typename std::tuple_element<6, OutputTuple>::type T6;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>, typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>,
tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5>, tag_matching_port<T6> tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5>, tag_matching_port<T6>
> input_ports_tuple_type; > input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename internal::function_body<T6, tag_value> *f6_p; typedef typename internal::function_body<T6, tag_value> *f6_p;
typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5_p, f6 _p > func_initializer_type; typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5_p, f6 _p > func_initializer_type;
public: public:
template<typename B0, typename B1, typename B2, typename B3, typena me B4, typename B5, typename B6> template<typename B0, typename B1, typename B2, typename B3, typena me B4, typename B5, typename B6>
skipping to change at line 1544 skipping to change at line 1545
typedef typename std::tuple_element<1, OutputTuple>::type T1; typedef typename std::tuple_element<1, OutputTuple>::type T1;
typedef typename std::tuple_element<2, OutputTuple>::type T2; typedef typename std::tuple_element<2, OutputTuple>::type T2;
typedef typename std::tuple_element<3, OutputTuple>::type T3; typedef typename std::tuple_element<3, OutputTuple>::type T3;
typedef typename std::tuple_element<4, OutputTuple>::type T4; typedef typename std::tuple_element<4, OutputTuple>::type T4;
typedef typename std::tuple_element<5, OutputTuple>::type T5; typedef typename std::tuple_element<5, OutputTuple>::type T5;
typedef typename std::tuple_element<6, OutputTuple>::type T6; typedef typename std::tuple_element<6, OutputTuple>::type T6;
typedef typename std::tuple_element<7, OutputTuple>::type T7; typedef typename std::tuple_element<7, OutputTuple>::type T7;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>, typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>,
tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5>, tag_matching_port<T6>, tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5>, tag_matching_port<T6>,
tag_matching_port<T7> > input_ports_tuple_type; tag_matching_port<T7> > input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename internal::function_body<T6, tag_value> *f6_p; typedef typename internal::function_body<T6, tag_value> *f6_p;
typedef typename internal::function_body<T7, tag_value> *f7_p; typedef typename internal::function_body<T7, tag_value> *f7_p;
typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5_p, f6 _p, f7_p > func_initializer_type; typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5_p, f6 _p, f7_p > func_initializer_type;
public: public:
skipping to change at line 1599 skipping to change at line 1600
typedef typename std::tuple_element<2, OutputTuple>::type T2; typedef typename std::tuple_element<2, OutputTuple>::type T2;
typedef typename std::tuple_element<3, OutputTuple>::type T3; typedef typename std::tuple_element<3, OutputTuple>::type T3;
typedef typename std::tuple_element<4, OutputTuple>::type T4; typedef typename std::tuple_element<4, OutputTuple>::type T4;
typedef typename std::tuple_element<5, OutputTuple>::type T5; typedef typename std::tuple_element<5, OutputTuple>::type T5;
typedef typename std::tuple_element<6, OutputTuple>::type T6; typedef typename std::tuple_element<6, OutputTuple>::type T6;
typedef typename std::tuple_element<7, OutputTuple>::type T7; typedef typename std::tuple_element<7, OutputTuple>::type T7;
typedef typename std::tuple_element<8, OutputTuple>::type T8; typedef typename std::tuple_element<8, OutputTuple>::type T8;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>, typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>,
tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5>, tag_matching_port<T6>, tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5>, tag_matching_port<T6>,
tag_matching_port<T7>, tag_matching_port<T8> > input_ports_ tuple_type; tag_matching_port<T7>, tag_matching_port<T8> > input_ports_ type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename internal::function_body<T6, tag_value> *f6_p; typedef typename internal::function_body<T6, tag_value> *f6_p;
typedef typename internal::function_body<T7, tag_value> *f7_p; typedef typename internal::function_body<T7, tag_value> *f7_p;
typedef typename internal::function_body<T8, tag_value> *f8_p; typedef typename internal::function_body<T8, tag_value> *f8_p;
typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5_p, f6 _p, f7_p, f8_p > func_initializer_type; typedef typename std::tuple< f0_p, f1_p, f2_p, f3_p, f4_p, f5_p, f6 _p, f7_p, f8_p > func_initializer_type;
skipping to change at line 1658 skipping to change at line 1659
typedef typename std::tuple_element<3, OutputTuple>::type T3; typedef typename std::tuple_element<3, OutputTuple>::type T3;
typedef typename std::tuple_element<4, OutputTuple>::type T4; typedef typename std::tuple_element<4, OutputTuple>::type T4;
typedef typename std::tuple_element<5, OutputTuple>::type T5; typedef typename std::tuple_element<5, OutputTuple>::type T5;
typedef typename std::tuple_element<6, OutputTuple>::type T6; typedef typename std::tuple_element<6, OutputTuple>::type T6;
typedef typename std::tuple_element<7, OutputTuple>::type T7; typedef typename std::tuple_element<7, OutputTuple>::type T7;
typedef typename std::tuple_element<8, OutputTuple>::type T8; typedef typename std::tuple_element<8, OutputTuple>::type T8;
typedef typename std::tuple_element<9, OutputTuple>::type T9; typedef typename std::tuple_element<9, OutputTuple>::type T9;
public: public:
typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>, typedef typename std::tuple< tag_matching_port<T0>, tag_matching_po rt<T1>, tag_matching_port<T2>,
tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5>, tag_matching_port<T6>, tag_matching_port<T3>, tag_matching_port<T4>, tag_matching_ port<T5>, tag_matching_port<T6>,
tag_matching_port<T7>, tag_matching_port<T8>, tag_matching_ port<T9> > input_ports_tuple_type; tag_matching_port<T7>, tag_matching_port<T8>, tag_matching_ port<T9> > input_ports_type;
typedef OutputTuple output_type; typedef OutputTuple output_type;
private: private:
typedef join_node_base<tag_matching, input_ports_tuple_type, output _type > base_type; typedef join_node_base<tag_matching, input_ports_type, output_type > base_type;
typedef typename internal::function_body<T0, tag_value> *f0_p; typedef typename internal::function_body<T0, tag_value> *f0_p;
typedef typename internal::function_body<T1, tag_value> *f1_p; typedef typename internal::function_body<T1, tag_value> *f1_p;
typedef typename internal::function_body<T2, tag_value> *f2_p; typedef typename internal::function_body<T2, tag_value> *f2_p;
typedef typename internal::function_body<T3, tag_value> *f3_p; typedef typename internal::function_body<T3, tag_value> *f3_p;
typedef typename internal::function_body<T4, tag_value> *f4_p; typedef typename internal::function_body<T4, tag_value> *f4_p;
typedef typename internal::function_body<T5, tag_value> *f5_p; typedef typename internal::function_body<T5, tag_value> *f5_p;
typedef typename internal::function_body<T6, tag_value> *f6_p; typedef typename internal::function_body<T6, tag_value> *f6_p;
typedef typename internal::function_body<T7, tag_value> *f7_p; typedef typename internal::function_body<T7, tag_value> *f7_p;
typedef typename internal::function_body<T8, tag_value> *f8_p; typedef typename internal::function_body<T8, tag_value> *f8_p;
typedef typename internal::function_body<T9, tag_value> *f9_p; typedef typename internal::function_body<T9, tag_value> *f9_p;
skipping to change at line 1693 skipping to change at line 1694
new internal::function_body_leaf<T6, tag_value, B6>(b6) , new internal::function_body_leaf<T6, tag_value, B6>(b6) ,
new internal::function_body_leaf<T7, tag_value, B7>(b7) , new internal::function_body_leaf<T7, tag_value, B7>(b7) ,
new internal::function_body_leaf<T8, tag_value, B8>(b8) , new internal::function_body_leaf<T8, tag_value, B8>(b8) ,
new internal::function_body_leaf<T9, tag_value, B9>(b9) new internal::function_body_leaf<T9, tag_value, B9>(b9)
) ) {} ) ) {}
unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {} unfolded_join_node(const unfolded_join_node &other) : base_type(oth er) {}
}; };
//! templated function to refer to input ports of the join node //! templated function to refer to input ports of the join node
template<size_t N, typename JNT> template<size_t N, typename JNT>
typename std::tuple_element<N, typename JNT::input_ports_tuple_type>::t typename std::tuple_element<N, typename JNT::input_ports_type>::type &i
ype &input_port(JNT &jn) { nput_port(JNT &jn) {
return std::get<N>(jn.inputs()); return std::get<N>(jn.input_ports());
} }
} }
#endif // __TBB__flow_graph_join_impl_H #endif // __TBB__flow_graph_join_impl_H
 End of changes. 47 change blocks. 
51 lines changed or deleted 51 lines changed or added


 _flow_graph_node_impl.h   _flow_graph_node_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 301 skipping to change at line 301
void apply_body_impl( const input_type &i) { void apply_body_impl( const input_type &i) {
successors().try_put( (*my_body)(i) ); successors().try_put( (*my_body)(i) );
} }
protected: protected:
function_body<input_type, output_type> *my_body; function_body<input_type, output_type> *my_body;
virtual broadcast_cache<output_type > &successors() = 0; virtual broadcast_cache<output_type > &successors() = 0;
}; };
#if TBB_PREVIEW_GRAPH_NODES
//! Implements methods for a function node that takes a type Input as i nput //! Implements methods for a function node that takes a type Input as i nput
// and has a tuple of output ports specified. // and has a tuple of output ports specified.
template< typename Input, typename OutputPortSet, typename A> template< typename Input, typename OutputPortSet, typename A>
class multioutput_function_input : public function_input_base<Input, A, multioutput_function_input<Input,OutputPortSet,A> > { class multifunction_input : public function_input_base<Input, A, multif unction_input<Input,OutputPortSet,A> > {
public: public:
typedef Input input_type; typedef Input input_type;
typedef OutputPortSet output_ports_type; typedef OutputPortSet output_ports_type;
typedef multioutput_function_input<Input,OutputPortSet,A> my_class; typedef multifunction_input<Input,OutputPortSet,A> my_class;
typedef function_input_base<Input, A, my_class> base_type; typedef function_input_base<Input, A, my_class> base_type;
typedef function_input_queue<input_type, A> input_queue_type; typedef function_input_queue<input_type, A> input_queue_type;
// constructor // constructor
template<typename Body> template<typename Body>
multioutput_function_input( multifunction_input(
graph &g, graph &g,
size_t max_concurrency, size_t max_concurrency,
Body& body, Body& body,
function_input_queue<input_type,A> *q = NULL ) : function_input_queue<input_type,A> *q = NULL ) :
base_type(g, max_concurrency, q), base_type(g, max_concurrency, q),
my_body( new internal::multioutput_function_body_leaf<input_typ e, output_ports_type, Body>(body) ) { my_body( new internal::multifunction_body_leaf<input_type, outp ut_ports_type, Body>(body) ) {
} }
//! Copy constructor //! Copy constructor
multioutput_function_input( const multioutput_function_input& src, input_queue_type *q = NULL ) : multifunction_input( const multifunction_input& src, input_queue_ty pe *q = NULL ) :
base_type(src, q), base_type(src, q),
my_body( src.my_body->clone() ) { my_body( src.my_body->clone() ) {
} }
~multioutput_function_input() { ~multifunction_input() {
delete my_body; delete my_body;
} }
template< typename Body > template< typename Body >
Body copy_function_object() { Body copy_function_object() {
internal::multioutput_function_body<input_type, output_ports_ty internal::multifunction_body<input_type, output_ports_type> &bo
pe> &body_ref = *this->my_body; dy_ref = *this->my_body;
return dynamic_cast< internal::multioutput_function_body_leaf<i return dynamic_cast< internal::multifunction_body_leaf<input_ty
nput_type, output_ports_type, Body> & >(body_ref).get_body(); pe, output_ports_type, Body> & >(body_ref).get_body();
} }
void apply_body_impl( const input_type &i) { void apply_body_impl( const input_type &i) {
(*my_body)(i, my_output_ports); (*my_body)(i, my_output_ports);
} }
output_ports_type &output_ports(){ return my_output_ports; } output_ports_type &output_ports(){ return my_output_ports; }
protected: protected:
multioutput_function_body<input_type, output_ports_type> *my_body; multifunction_body<input_type, output_ports_type> *my_body;
output_ports_type my_output_ports; output_ports_type my_output_ports;
}; };
// template to refer to an output port of a multioutput_function_node // template to refer to an output port of a multifunction_node
template<size_t N, typename MOP> template<size_t N, typename MOP>
typename std::tuple_element<N, typename MOP::output_ports_type>::type & output_port(MOP &op) { typename std::tuple_element<N, typename MOP::output_ports_type>::type & output_port(MOP &op) {
return std::get<N>(op.output_ports()); return std::get<N>(op.output_ports());
} }
// helper structs for split_node // helper structs for split_node
template<int N> template<int N>
struct emit_element { struct emit_element {
template<typename T, typename P> template<typename T, typename P>
static void emit_this(const T &t, P &p) { static void emit_this(const T &t, P &p) {
std::get<N-1>(p).put(std::get<N-1>(t)); (void)std::get<N-1>(p).try_put(std::get<N-1>(t));
emit_element<N-1>::emit_this(t,p); emit_element<N-1>::emit_this(t,p);
} }
}; };
template<> template<>
struct emit_element<1> { struct emit_element<1> {
template<typename T, typename P> template<typename T, typename P>
static void emit_this(const T &t, P &p) { static void emit_this(const T &t, P &p) {
std::get<0>(p).put(std::get<0>(t)); (void)std::get<0>(p).try_put(std::get<0>(t));
} }
}; };
#endif // TBB_PREVIEW_GRAPH_NODES
//! Implements methods for an executable node that takes continue_msg a s input //! Implements methods for an executable node that takes continue_msg a s input
template< typename Output > template< typename Output >
class continue_input : public continue_receiver { class continue_input : public continue_receiver {
public: public:
//! The input type of this receiver //! The input type of this receiver
typedef continue_msg input_type; typedef continue_msg input_type;
//! The output type of this receiver //! The output type of this receiver
skipping to change at line 453 skipping to change at line 451
successors().register_successor( r ); successors().register_successor( r );
return true; return true;
} }
//! Removes a successor from this node //! Removes a successor from this node
/* override */ bool remove_successor( receiver<output_type> &r ) { /* override */ bool remove_successor( receiver<output_type> &r ) {
successors().remove_successor( r ); successors().remove_successor( r );
return true; return true;
} }
// for multioutput_function_node. The function_body that implement s // for multifunction_node. The function_body that implements
// the node will have an input and an output tuple of ports. To pu t // the node will have an input and an output tuple of ports. To pu t
// an item to a successor, the body should // an item to a successor, the body should
// //
// get<I>(output_ports).put(output_value); // get<I>(output_ports).try_put(output_value);
// //
// successors must always accept (for instance, a queue_node) or it // return value will be bool returned from successors.try_put.
ems bool try_put(const output_type &i) { return my_successors.try_put(i
// may be dropped. ); }
void put(const output_type &i) { my_successors.try_put(i); }
protected: protected:
broadcast_cache<output_type> my_successors; broadcast_cache<output_type> my_successors;
broadcast_cache<output_type > &successors() { return my_successors; } broadcast_cache<output_type > &successors() { return my_successors; }
}; };
} // internal } // internal
#endif // __TBB__flow_graph_node_impl_H #endif // __TBB__flow_graph_node_impl_H
 End of changes. 17 change blocks. 
23 lines changed or deleted 20 lines changed or added


 _flow_graph_or_impl.h   _flow_graph_or_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 141 skipping to change at line 141
class or_node_FE : public put_base { class or_node_FE : public put_base {
public: public:
static const int N = std::tuple_size<InputTuple>::value; static const int N = std::tuple_size<InputTuple>::value;
typedef OutputType output_type; typedef OutputType output_type;
typedef InputTuple input_type; typedef InputTuple input_type;
or_node_FE( ) { or_node_FE( ) {
or_helper<StructTypes,N>::set_or_node_pointer(my_inputs, this); or_helper<StructTypes,N>::set_or_node_pointer(my_inputs, this);
} }
input_type &inputs() { return my_inputs; } input_type &input_ports() { return my_inputs; }
protected: protected:
input_type my_inputs; input_type my_inputs;
}; };
//! or_node_base //! or_node_base
template<typename InputTuple, typename OutputType, typename StructTypes > template<typename InputTuple, typename OutputType, typename StructTypes >
class or_node_base : public graph_node, public or_node_FE<InputTuple, O utputType,StructTypes>, class or_node_base : public graph_node, public or_node_FE<InputTuple, O utputType,StructTypes>,
public sender<OutputType> { public sender<OutputType> {
using graph_node::my_graph;
public: public:
static const size_t N = std::tuple_size<InputTuple>::value; static const size_t N = std::tuple_size<InputTuple>::value;
typedef OutputType output_type; typedef OutputType output_type;
typedef StructTypes tuple_types; typedef StructTypes tuple_types;
typedef receiver<output_type> successor_type; typedef receiver<output_type> successor_type;
typedef or_node_FE<InputTuple, output_type,StructTypes> input_ports _type; typedef or_node_FE<InputTuple, output_type,StructTypes> input_ports _type;
private: private:
// ----------- Aggregator ------------ // ----------- Aggregator ------------
enum op_type { reg_succ, rem_succ, try__put }; enum op_type { reg_succ, rem_succ, try__put };
skipping to change at line 210 skipping to change at line 211
output_type oval; output_type oval;
or_helper<tuple_types,N>::create_output(oval,current->i ndx,current->my_arg); or_helper<tuple_types,N>::create_output(oval,current->i ndx,current->my_arg);
bool res = my_successors.try_put(oval); bool res = my_successors.try_put(oval);
__TBB_store_with_release(current->status, res ? SUCCEED ED : FAILED); __TBB_store_with_release(current->status, res ? SUCCEED ED : FAILED);
break; break;
} }
} }
} }
// ---------- end aggregator ----------- // ---------- end aggregator -----------
public: public:
or_node_base( ) : input_ports_type() { or_node_base(graph& g) : graph_node(g), input_ports_type() {
my_successors.set_owner(this); my_successors.set_owner(this);
my_aggregator.initialize_handler(my_handler(this)); my_aggregator.initialize_handler(my_handler(this));
} }
or_node_base( const or_node_base& /*other*/) : input_ports_type() { or_node_base(const or_node_base& other) : graph_node(other.my_graph ), input_ports_type(), sender<output_type>() {
my_successors.set_owner(this); my_successors.set_owner(this);
my_aggregator.initialize_handler(my_handler(this)); my_aggregator.initialize_handler(my_handler(this));
} }
bool register_successor(successor_type &r) { bool register_successor(successor_type &r) {
or_node_base_operation op_data(r, reg_succ); or_node_base_operation op_data(r, reg_succ);
my_aggregator.execute(&op_data); my_aggregator.execute(&op_data);
return op_data.status == SUCCEEDED; return op_data.status == SUCCEEDED;
} }
skipping to change at line 246 skipping to change at line 247
} }
private: private:
broadcast_cache<output_type, null_rw_mutex> my_successors; broadcast_cache<output_type, null_rw_mutex> my_successors;
}; };
// type generators // type generators
template<typename OutputTuple> template<typename OutputTuple>
struct or_types { struct or_types {
static const int N = std::tuple_size<OutputTuple>::value; static const int N = std::tuple_size<OutputTuple>::value;
typedef typename wrap_tuple_elements<N,or_input_port,OutputTuple>:: type input_ports_tuple_type; typedef typename wrap_tuple_elements<N,or_input_port,OutputTuple>:: type input_ports_type;
typedef typename or_output_type<OutputTuple>::type output_type; typedef typename or_output_type<OutputTuple>::type output_type;
typedef internal::or_node_FE<input_ports_tuple_type,output_type,Out typedef internal::or_node_FE<input_ports_type,output_type,OutputTup
putTuple> or_FE_type; le> or_FE_type;
typedef internal::or_node_base<input_ports_tuple_type, output_type, typedef internal::or_node_base<input_ports_type, output_type, Outpu
OutputTuple> or_base_type; tTuple> or_base_type;
}; };
template<class OutputTuple> template<class OutputTuple>
class unfolded_or_node : public or_types<OutputTuple>::or_base_type { class unfolded_or_node : public or_types<OutputTuple>::or_base_type {
public: public:
typedef typename or_types<OutputTuple>::input_ports_tuple_type inpu t_ports_tuple_type; typedef typename or_types<OutputTuple>::input_ports_type input_port s_type;
typedef OutputTuple tuple_types; typedef OutputTuple tuple_types;
typedef typename or_types<OutputTuple>::output_type output_type; typedef typename or_types<OutputTuple>::output_type output_type;
private: private:
typedef typename or_types<OutputTuple>::or_base_type base_type; typedef typename or_types<OutputTuple>::or_base_type base_type;
public: public:
unfolded_or_node() : base_type() {} unfolded_or_node(graph& g) : base_type(g) {}
unfolded_or_node(const unfolded_or_node &other) : base_type(other)
{}
}; };
} /* namespace internal */ } /* namespace internal */
#endif // TBB_PREVIEW_GRAPH_NODES #endif // TBB_PREVIEW_GRAPH_NODES
#endif /* __TBB__flow_graph_or_impl_H */ #endif /* __TBB__flow_graph_or_impl_H */
 End of changes. 9 change blocks. 
11 lines changed or deleted 14 lines changed or added


 _flow_graph_tagged_buffer_impl.h   _flow_graph_tagged_buffer_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 _flow_graph_types_impl.h   _flow_graph_types_impl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 _tbb_windef.h   _tbb_windef.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 aligned_space.h   aligned_space.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 atomic.h   atomic.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 blocked_range.h   blocked_range.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 blocked_range2d.h   blocked_range2d.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 blocked_range3d.h   blocked_range3d.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 cache_aligned_allocator.h   cache_aligned_allocator.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 combinable.h   combinable.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 concurrent_hash_map.h   concurrent_hash_map.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 concurrent_lru_cache.h   concurrent_lru_cache.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 concurrent_priority_queue.h   concurrent_priority_queue.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 concurrent_queue.h   concurrent_queue.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 concurrent_unordered_map.h   concurrent_unordered_map.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 concurrent_unordered_set.h   concurrent_unordered_set.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 concurrent_vector.h   concurrent_vector.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 condition_variable   condition_variable 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 critical_section.h   critical_section.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 enumerable_thread_specific.h   enumerable_thread_specific.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 flow_graph.h   flow_graph.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 71 skipping to change at line 71
*/ */
namespace tbb { namespace tbb {
namespace flow { namespace flow {
//! An enumeration the provides the two most common concurrency levels: unl imited and serial //! An enumeration the provides the two most common concurrency levels: unl imited and serial
enum concurrency { unlimited = 0, serial = 1 }; enum concurrency { unlimited = 0, serial = 1 };
namespace interface6 { namespace interface6 {
//! The base of all graph nodes. Allows them to be stored in a collection
for deletion.
class graph_node {
public:
virtual ~graph_node() {}
};
//! An empty class used for messages that mean "I'm done" //! An empty class used for messages that mean "I'm done"
class continue_msg {}; class continue_msg {};
template< typename T > class sender; template< typename T > class sender;
template< typename T > class receiver; template< typename T > class receiver;
class continue_receiver; class continue_receiver;
//! Pure virtual template class that defines a sender of messages of type T //! Pure virtual template class that defines a sender of messages of type T
template< typename T > template< typename T >
class sender { class sender {
skipping to change at line 113 skipping to change at line 107
virtual bool try_get( T & ) { return false; } virtual bool try_get( T & ) { return false; }
//! Reserves an item in the sender //! Reserves an item in the sender
virtual bool try_reserve( T & ) { return false; } virtual bool try_reserve( T & ) { return false; }
//! Releases the reserved item //! Releases the reserved item
virtual bool try_release( ) { return false; } virtual bool try_release( ) { return false; }
//! Consumes the reserved item //! Consumes the reserved item
virtual bool try_consume( ) { return false; } virtual bool try_consume( ) { return false; }
}; };
//! Pure virtual template class that defines a receiver of messages of type T //! Pure virtual template class that defines a receiver of messages of type T
template< typename T > template< typename T >
class receiver { class receiver {
public: public:
//! The input type of this receiver //! The input type of this receiver
typedef T input_type; typedef T input_type;
//! The predecessor type for this node //! The predecessor type for this node
typedef sender<T> predecessor_type; typedef sender<T> predecessor_type;
//! Destructor //! Destructor
virtual ~receiver() {} virtual ~receiver() {}
//! Put an item to the receiver //! Put an item to the receiver
virtual bool try_put( const T& t ) = 0; virtual bool try_put( const T& t ) = 0;
//! Add a predecessor to the node //! Add a predecessor to the node
virtual bool register_predecessor( predecessor_type & ) { return false; } virtual bool register_predecessor( predecessor_type & ) { return false; }
//! Remove a predecessor from the node //! Remove a predecessor from the node
virtual bool remove_predecessor( predecessor_type & ) { return false; } virtual bool remove_predecessor( predecessor_type & ) { return false; }
}; };
//! Base class for receivers of completion messages //! Base class for receivers of completion messages
/** These receivers automatically reset, but cannot be explicitly waited on */ /** These receivers automatically reset, but cannot be explicitly waited on */
class continue_receiver : public receiver< continue_msg > { class continue_receiver : public receiver< continue_msg > {
public: public:
//! The input type //! The input type
typedef continue_msg input_type; typedef continue_msg input_type;
skipping to change at line 200 skipping to change at line 191
if ( ++my_current_count < my_predecessor_count ) if ( ++my_current_count < my_predecessor_count )
return true; return true;
else else
my_current_count = 0; my_current_count = 0;
} }
execute(); execute();
return true; return true;
} }
protected: protected:
spin_mutex my_mutex; spin_mutex my_mutex;
int my_predecessor_count; int my_predecessor_count;
int my_current_count; int my_current_count;
int my_initial_predecessor_count; int my_initial_predecessor_count;
//! Does whatever should happen when the threshold is reached //! Does whatever should happen when the threshold is reached
/** This should be very fast or else spawn a task. This is /** This should be very fast or else spawn a task. This is
called while the sender is blocked in the try_put(). */ called while the sender is blocked in the try_put(). */
virtual void execute() = 0; virtual void execute() = 0;
}; };
#include "internal/_flow_graph_impl.h" #include "internal/_flow_graph_impl.h"
using namespace internal::graph_policy_namespace; using namespace internal::graph_policy_namespace;
class graph;
class graph_node;
template <typename GraphContainerType, typename GraphNodeType>
class graph_iterator {
friend class graph;
friend class graph_node;
public:
typedef size_t size_type;
typedef GraphNodeType value_type;
typedef GraphNodeType* pointer;
typedef GraphNodeType& reference;
typedef const GraphNodeType& const_reference;
typedef std::forward_iterator_tag iterator_category;
//! Default constructor
graph_iterator() : my_graph(NULL), current_node(NULL) {}
//! Copy constructor
graph_iterator(const graph_iterator& other) :
my_graph(other.my_graph), current_node(other.current_node)
{}
//! Assignment
graph_iterator& operator=(const graph_iterator& other) {
if (this != &other) {
my_graph = other.my_graph;
current_node = other.current_node;
}
return *this;
}
//! Dereference
reference operator*() const;
//! Dereference
pointer operator->() const;
//! Equality
bool operator==(const graph_iterator& other) const {
return ((my_graph == other.my_graph) && (current_node == other.curr
ent_node));
}
//! Inequality
bool operator!=(const graph_iterator& other) const { return !(operator=
=(other)); }
//! Pre-increment
graph_iterator& operator++() {
internal_forward();
return *this;
}
//! Post-increment
graph_iterator operator++(int) {
graph_iterator result = *this;
operator++();
return result;
}
private:
// the graph over which we are iterating
GraphContainerType *my_graph;
// pointer into my_graph's my_nodes list
pointer current_node;
//! Private initializing constructor for begin() and end() iterators
graph_iterator(GraphContainerType *g, bool begin);
void internal_forward();
};
//! The graph class //! The graph class
/** This class serves as a handle to the graph */ /** This class serves as a handle to the graph */
class graph : tbb::internal::no_copy { class graph : tbb::internal::no_copy {
friend class graph_node;
template< typename Body > template< typename Body >
class run_task : public task { class run_task : public task {
public: public:
run_task( Body& body ) : my_body(body) {} run_task( Body& body ) : my_body(body) {}
task *execute() { task *execute() {
my_body(); my_body();
return NULL; return NULL;
} }
private: private:
skipping to change at line 246 skipping to change at line 306
task *execute() { task *execute() {
my_receiver.try_put( my_body() ); my_receiver.try_put( my_body() );
return NULL; return NULL;
} }
private: private:
Receiver &my_receiver; Receiver &my_receiver;
Body my_body; Body my_body;
}; };
public: public:
//! Constructs a graph with isolated task_group_context
explicit graph() : my_nodes(NULL), my_nodes_last(NULL)
{
own_context = true;
my_context = new task_group_context();
my_root_task = ( new ( task::allocate_root(*my_context) ) empty_tas
k );
my_root_task->set_ref_count(1);
}
//! Constructs a graph withy no nodes. //! Constructs a graph with use_this_context as context
graph() : my_root_task( new ( task::allocate_root( ) ) empty_task ) { explicit graph(task_group_context& use_this_context) :
my_context(&use_this_context), my_nodes(NULL), my_nodes_last(NULL)
{
own_context = false;
my_root_task = ( new ( task::allocate_root(*my_context) ) empty_tas
k );
my_root_task->set_ref_count(1); my_root_task->set_ref_count(1);
} }
//! Destroys the graph. //! Destroys the graph.
/** Calls wait_for_all on the graph, deletes all of the nodes appended /** Calls wait_for_all, then destroys the root task and context. */
by calls to add, and then
destroys the root task of the graph. */
~graph() { ~graph() {
wait_for_all(); wait_for_all();
my_root_task->set_ref_count(0); my_root_task->set_ref_count(0);
task::destroy( *my_root_task ); task::destroy( *my_root_task );
if (own_context) delete my_context;
} }
//! Used to register that an external entity may still interact with th e graph. //! Used to register that an external entity may still interact with th e graph.
/** The graph will not return from wait_for_all until a matching number of decrement_wait_count calls /** The graph will not return from wait_for_all until a matching number of decrement_wait_count calls
is made. */ is made. */
void increment_wait_count() { void increment_wait_count() {
if (my_root_task) if (my_root_task)
my_root_task->increment_ref_count(); my_root_task->increment_ref_count();
} }
skipping to change at line 295 skipping to change at line 367
//! Spawns a task that runs a function object //! Spawns a task that runs a function object
/** The task is spawned as a child of the graph. This is useful for run ning tasks /** The task is spawned as a child of the graph. This is useful for run ning tasks
that need to block a wait_for_all() on the graph. For example a one -off source. */ that need to block a wait_for_all() on the graph. For example a one -off source. */
template< typename Body > template< typename Body >
void run( Body body ) { void run( Body body ) {
task::enqueue( * new ( task::allocate_additional_child_of( *my_root_ task ) ) task::enqueue( * new ( task::allocate_additional_child_of( *my_root_ task ) )
run_task< Body >( body ) ); run_task< Body >( body ) );
} }
//! Waits until the graph is idle and the number of decrement_wait_coun t calls equals the number of increment_wait_count calls. //! Wait until graph is idle and decrement_wait_count calls equals incr ement_wait_count calls.
/** The waiting thread will go off and steal work while it is block in the wait_for_all. */ /** The waiting thread will go off and steal work while it is block in the wait_for_all. */
void wait_for_all() { void wait_for_all() {
if (my_root_task) if (my_root_task)
my_root_task->wait_for_all(); my_root_task->wait_for_all();
my_root_task->set_ref_count(1); my_root_task->set_ref_count(1);
} }
//! Returns the root task of the graph //! Returns the root task of the graph
task * root_task() { task * root_task() {
return my_root_task; return my_root_task;
} }
private: // ITERATORS
template<typename C, typename N>
friend class graph_iterator;
// Graph iterator typedefs
typedef graph_iterator<graph,graph_node> iterator;
typedef graph_iterator<const graph,const graph_node> const_iterator;
// Graph iterator constructors
//! start iterator
iterator begin() { return iterator(this, true); }
//! end iterator
iterator end() { return iterator(this, false); }
//! start const iterator
const_iterator begin() const { return const_iterator(this, true); }
//! end const iterator
const_iterator end() const { return const_iterator(this, false); }
//! start const iterator
const_iterator cbegin() const { return const_iterator(this, true); }
//! end const iterator
const_iterator cend() const { return const_iterator(this, false); }
private:
task *my_root_task; task *my_root_task;
task_group_context *my_context;
bool own_context;
graph_node *my_nodes, *my_nodes_last;
spin_mutex nodelist_mutex;
void register_node(graph_node *n);
void remove_node(graph_node *n);
}; };
template <typename C, typename N>
graph_iterator<C,N>::graph_iterator(C *g, bool begin) : my_graph(g), curren
t_node(NULL)
{
if (begin) current_node = my_graph->my_nodes;
//else it is an end iterator by default
}
template <typename C, typename N>
typename graph_iterator<C,N>::reference graph_iterator<C,N>::operator*() co
nst {
__TBB_ASSERT(current_node, "graph_iterator at end");
return *operator->();
}
template <typename C, typename N>
typename graph_iterator<C,N>::pointer graph_iterator<C,N>::operator->() con
st {
return current_node;
}
template <typename C, typename N>
void graph_iterator<C,N>::internal_forward() {
if (current_node) current_node = current_node->next;
}
//! The base of all graph nodes.
class graph_node : tbb::internal::no_assign {
friend class graph;
template<typename C, typename N>
friend class graph_iterator;
protected:
graph& my_graph;
graph_node *next, *prev;
public:
graph_node(graph& g) : my_graph(g) {
my_graph.register_node(this);
}
virtual ~graph_node() {
my_graph.remove_node(this);
}
};
void graph::register_node(graph_node *n) {
n->next = NULL;
{
spin_mutex::scoped_lock lock(nodelist_mutex);
n->prev = my_nodes_last;
if (my_nodes_last) my_nodes_last->next = n;
my_nodes_last = n;
if (!my_nodes) my_nodes = n;
}
}
void graph::remove_node(graph_node *n) {
{
spin_mutex::scoped_lock lock(nodelist_mutex);
__TBB_ASSERT(my_nodes && my_nodes_last, "graph::remove_node: Error:
no registered nodes");
if (n->prev) n->prev->next = n->next;
if (n->next) n->next->prev = n->prev;
if (my_nodes_last == n) my_nodes_last = n->prev;
if (my_nodes == n) my_nodes = n->next;
}
n->prev = n->next = NULL;
}
#include "internal/_flow_graph_node_impl.h" #include "internal/_flow_graph_node_impl.h"
//! An executable node that acts as a source, i.e. it has no predecessors //! An executable node that acts as a source, i.e. it has no predecessors
template < typename Output > template < typename Output >
class source_node : public graph_node, public sender< Output > { class source_node : public graph_node, public sender< Output > {
using graph_node::my_graph;
public: public:
//! The type of the output message, which is complete //! The type of the output message, which is complete
typedef Output output_type; typedef Output output_type;
//! The type of successors of this node //! The type of successors of this node
typedef receiver< Output > successor_type; typedef receiver< Output > successor_type;
//! Constructor for a node with a successor //! Constructor for a node with a successor
template< typename Body > template< typename Body >
source_node( graph &g, Body body, bool is_active = true ) source_node( graph &g, Body body, bool is_active = true )
: my_root_task(g.root_task()), my_active(is_active), init_my_active (is_active), : graph_node(g), my_root_task(g.root_task()), my_active(is_active), init_my_active(is_active),
my_body( new internal::source_body_leaf< output_type, Body>(body) ) , my_body( new internal::source_body_leaf< output_type, Body>(body) ) ,
my_reserved(false), my_has_cached_item(false) my_reserved(false), my_has_cached_item(false)
{ {
my_successors.set_owner(this); my_successors.set_owner(this);
} }
//! Copy constructor //! Copy constructor
source_node( const source_node& src ) : source_node( const source_node& src ) :
graph_node(), sender<Output>(), graph_node(src.my_graph), sender<Output>(),
my_root_task( src.my_root_task), my_active(src.init_my_active), my_root_task( src.my_root_task), my_active(src.init_my_active),
init_my_active(src.init_my_active), my_body( src.my_body->clone() ) , init_my_active(src.init_my_active), my_body( src.my_body->clone() ) ,
my_reserved(false), my_has_cached_item(false) my_reserved(false), my_has_cached_item(false)
{ {
my_successors.set_owner(this); my_successors.set_owner(this);
} }
//! The destructor //! The destructor
~source_node() { delete my_body; } ~source_node() { delete my_body; }
skipping to change at line 401 skipping to change at line 564
if ( my_has_cached_item ) { if ( my_has_cached_item ) {
v = my_cached_item; v = my_cached_item;
my_reserved = true; my_reserved = true;
return true; return true;
} else { } else {
return false; return false;
} }
} }
//! Release a reserved item. //! Release a reserved item.
/** true = item has been released and so remains in sender, dest must request or reserve future items */ /** true = item has been released and so remains in sender, dest must r equest or reserve future items */
/* override */ bool try_release( ) { /* override */ bool try_release( ) {
spin_mutex::scoped_lock lock(my_mutex); spin_mutex::scoped_lock lock(my_mutex);
__TBB_ASSERT( my_reserved && my_has_cached_item, "releasing non-exi stent reservation" ); __TBB_ASSERT( my_reserved && my_has_cached_item, "releasing non-exi stent reservation" );
my_reserved = false; my_reserved = false;
spawn_put(); if(!my_successors.empty())
spawn_put();
return true; return true;
} }
//! Consumes a reserved item //! Consumes a reserved item
/* override */ bool try_consume( ) { /* override */ bool try_consume( ) {
spin_mutex::scoped_lock lock(my_mutex); spin_mutex::scoped_lock lock(my_mutex);
__TBB_ASSERT( my_reserved && my_has_cached_item, "consuming non-exi stent reservation" ); __TBB_ASSERT( my_reserved && my_has_cached_item, "consuming non-exi stent reservation" );
my_reserved = false; my_reserved = false;
my_has_cached_item = false; my_has_cached_item = false;
if ( !my_successors.empty() ) { if ( !my_successors.empty() ) {
skipping to change at line 431 skipping to change at line 595
//! Activates a node that was created in the inactive state //! Activates a node that was created in the inactive state
void activate() { void activate() {
spin_mutex::scoped_lock lock(my_mutex); spin_mutex::scoped_lock lock(my_mutex);
my_active = true; my_active = true;
if ( !my_successors.empty() ) if ( !my_successors.empty() )
spawn_put(); spawn_put();
} }
private: private:
task *my_root_task; task *my_root_task;
spin_mutex my_mutex; spin_mutex my_mutex;
bool my_active; bool my_active;
bool init_my_active; bool init_my_active;
internal::source_body<output_type> *my_body; internal::source_body<output_type> *my_body;
internal::broadcast_cache< output_type > my_successors; internal::broadcast_cache< output_type > my_successors;
bool my_reserved; bool my_reserved;
bool my_has_cached_item; bool my_has_cached_item;
output_type my_cached_item; output_type my_cached_item;
skipping to change at line 461 skipping to change at line 624
try_consume(); try_consume();
else else
try_release(); try_release();
} }
//! Spawns a task that applies the body //! Spawns a task that applies the body
/* override */ void spawn_put( ) { /* override */ void spawn_put( ) {
task::enqueue( * new ( task::allocate_additional_child_of( *my_root _task ) ) task::enqueue( * new ( task::allocate_additional_child_of( *my_root _task ) )
internal::source_task< source_node< output_type > >( *this ) ); internal::source_task< source_node< output_type > >( *this ) );
} }
}; };
//! Implements a function node that supports Input -> Output //! Implements a function node that supports Input -> Output
template < typename Input, typename Output = continue_msg, graph_buffer_pol icy = queueing, typename Allocator=cache_aligned_allocator<Input> > template < typename Input, typename Output = continue_msg, graph_buffer_pol icy = queueing, typename Allocator=cache_aligned_allocator<Input> >
class function_node : public graph_node, public internal::function_input<In put,Output,Allocator>, public internal::function_output<Output> { class function_node : public graph_node, public internal::function_input<In put,Output,Allocator>, public internal::function_output<Output> {
using graph_node::my_graph;
public: public:
typedef Input input_type; typedef Input input_type;
typedef Output output_type; typedef Output output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
typedef internal::function_input<input_type,output_type,Allocator> fInp ut_type;
typedef internal::function_output<output_type> fOutput_type; typedef internal::function_output<output_type> fOutput_type;
//! Constructor //! Constructor
template< typename Body > template< typename Body >
function_node( graph &g, size_t concurrency, Body body ) function_node( graph &g, size_t concurrency, Body body ) :
: internal::function_input<input_type,output_type,Allocator>( g, concur graph_node(g), internal::function_input<input_type,output_type,Allo
rency, body ) { cator>(g, concurrency, body)
} {}
//! Copy constructor //! Copy constructor
function_node( const function_node& src ) : function_node( const function_node& src ) :
graph_node(), internal::function_input<input_type,output_type,Alloc graph_node(src.my_graph), internal::function_input<input_type,outpu
ator>( src ), t_type,Allocator>( src ),
fOutput_type() {} fOutput_type()
{}
protected: bool try_put(const input_type &i) { return fInput_type::try_put(i); }
protected:
/* override */ internal::broadcast_cache<output_type> &successors () { return fOutput_type::my_successors; } /* override */ internal::broadcast_cache<output_type> &successors () { return fOutput_type::my_successors; }
}; };
//! Implements a function node that supports Input -> Output //! Implements a function node that supports Input -> Output
template < typename Input, typename Output, typename Allocator > template < typename Input, typename Output, typename Allocator >
class function_node<Input,Output,queueing,Allocator> : public graph_node, p ublic internal::function_input<Input,Output,Allocator>, public internal::fu nction_output<Output> { class function_node<Input,Output,queueing,Allocator> : public graph_node, p ublic internal::function_input<Input,Output,Allocator>, public internal::fu nction_output<Output> {
using graph_node::my_graph;
public: public:
typedef Input input_type; typedef Input input_type;
typedef Output output_type; typedef Output output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
typedef internal::function_input<input_type,output_type,Allocator> fInp ut_type; typedef internal::function_input<input_type,output_type,Allocator> fInp ut_type;
typedef internal::function_input_queue<input_type, Allocator> queue_typ e; typedef internal::function_input_queue<input_type, Allocator> queue_typ e;
typedef internal::function_output<output_type> fOutput_type; typedef internal::function_output<output_type> fOutput_type;
//! Constructor //! Constructor
template< typename Body > template< typename Body >
function_node( graph &g, size_t concurrency, Body body ) : fInput_type( function_node( graph &g, size_t concurrency, Body body ) :
g, concurrency, body, new queue_type() ) { graph_node(g), fInput_type( g, concurrency, body, new queue_type()
} )
{}
//! Copy constructor //! Copy constructor
function_node( const function_node& src ) : function_node( const function_node& src ) :
graph_node(), fInput_type( src, new queue_type() ) , fOutput_type() graph_node(src.my_graph), fInput_type( src, new queue_type() ), fOu
{ } tput_type()
{}
protected: bool try_put(const input_type &i) { return fInput_type::try_put(i); }
protected:
/* override */ internal::broadcast_cache<output_type> &successors () { return fOutput_type::my_successors; } /* override */ internal::broadcast_cache<output_type> &successors () { return fOutput_type::my_successors; }
}; };
#include "tbb/internal/_flow_graph_types_impl.h" #include "tbb/internal/_flow_graph_types_impl.h"
#if TBB_PREVIEW_GRAPH_NODES
//! implements a function node that supports Input -> (set of outputs) //! implements a function node that supports Input -> (set of outputs)
// Output is a tuple of output types. // Output is a tuple of output types.
template < typename Input, typename Output, graph_buffer_policy = queueing, typename Allocator=cache_aligned_allocator<Input> > template < typename Input, typename Output, graph_buffer_policy = queueing, typename Allocator=cache_aligned_allocator<Input> >
class multioutput_function_node : class multifunction_node :
public graph_node, public graph_node,
public internal::multioutput_function_input public internal::multifunction_input
< <
Input, Input,
typename internal::wrap_tuple_elements< typename internal::wrap_tuple_elements<
std::tuple_size<Output>::value, // #elements in tuple std::tuple_size<Output>::value, // #elements in tuple
internal::function_output, // wrap this around each element internal::function_output, // wrap this around each element
Output // the tuple providing the types Output // the tuple providing the types
>::type, >::type,
Allocator Allocator
> { > {
using graph_node::my_graph;
private: private:
static const int N = std::tuple_size<Output>::value; static const int N = std::tuple_size<Output>::value;
public: public:
typedef Input input_type; typedef Input input_type;
typedef typename internal::wrap_tuple_elements<N,internal::function_out put, Output>::type ports_type; typedef typename internal::wrap_tuple_elements<N,internal::function_out put, Output>::type output_ports_type;
private: private:
typedef typename internal::multioutput_function_input<input_type, ports _type, Allocator> base_type; typedef typename internal::multifunction_input<input_type, output_ports _type, Allocator> base_type;
typedef typename internal::function_input_queue<input_type,Allocator> q ueue_type; typedef typename internal::function_input_queue<input_type,Allocator> q ueue_type;
public: public:
template<typename Body> template<typename Body>
multioutput_function_node( graph &g, size_t concurrency, Body body ) : multifunction_node( graph &g, size_t concurrency, Body body ) :
base_type(g,concurrency, body) {} graph_node(g), base_type(g,concurrency, body)
multioutput_function_node( const multioutput_function_node &other) : {}
graph_node(), base_type(other) {} multifunction_node( const multifunction_node &other) :
// all the guts are in multioutput_function_input... graph_node(other.my_graph), base_type(other)
{}
}; // multioutput_function_node // all the guts are in multifunction_input...
}; // multifunction_node
template < typename Input, typename Output, typename Allocator > template < typename Input, typename Output, typename Allocator >
class multioutput_function_node<Input,Output,queueing,Allocator> : public g raph_node, public internal::multioutput_function_input<Input, class multifunction_node<Input,Output,queueing,Allocator> : public graph_no de, public internal::multifunction_input<Input,
typename internal::wrap_tuple_elements<std::tuple_size<Output>::value, internal::function_output, Output>::type, Allocator> { typename internal::wrap_tuple_elements<std::tuple_size<Output>::value, internal::function_output, Output>::type, Allocator> {
using graph_node::my_graph;
static const int N = std::tuple_size<Output>::value; static const int N = std::tuple_size<Output>::value;
public: public:
typedef Input input_type; typedef Input input_type;
typedef typename internal::wrap_tuple_elements<N, internal::function_ou tput, Output>::type ports_type; typedef typename internal::wrap_tuple_elements<N, internal::function_ou tput, Output>::type output_ports_type;
private: private:
typedef typename internal::multioutput_function_input<input_type, ports _type, Allocator> base_type; typedef typename internal::multifunction_input<input_type, output_ports _type, Allocator> base_type;
typedef typename internal::function_input_queue<input_type,Allocator> q ueue_type; typedef typename internal::function_input_queue<input_type,Allocator> q ueue_type;
public: public:
template<typename Body> template<typename Body>
multioutput_function_node( graph &g, size_t concurrency, Body body) : b multifunction_node( graph &g, size_t concurrency, Body body) :
ase_type(g,concurrency, body, new queue_type()) {} graph_node(g), base_type(g,concurrency, body, new queue_type())
multioutput_function_node( const multioutput_function_node &other) : {}
graph_node(), base_type(other, new queue_type()) {} multifunction_node( const multifunction_node &other) :
graph_node(other.my_graph), base_type(other, new queue_type())
}; // multioutput_function_node {}
}; // multifunction_node
//! split_node: accepts a tuple as input, forwards each element of the tupl e to its //! split_node: accepts a tuple as input, forwards each element of the tupl e to its
// successors. The node has unlimited concurrency, so though it is marked as // successors. The node has unlimited concurrency, so though it is marked as
// "rejecting" it does not reject inputs. // "rejecting" it does not reject inputs.
template<typename TupleType, typename Allocator=cache_aligned_allocator<Tup leType> > template<typename TupleType, typename Allocator=cache_aligned_allocator<Tup leType> >
class split_node : public multioutput_function_node<TupleType, TupleType, r ejecting, Allocator> { class split_node : public multifunction_node<TupleType, TupleType, rejectin g, Allocator> {
static const int N = std::tuple_size<TupleType>::value; static const int N = std::tuple_size<TupleType>::value;
typedef multioutput_function_node<TupleType,TupleType,rejecting,Allocat or> base_type; typedef multifunction_node<TupleType,TupleType,rejecting,Allocator> bas e_type;
public: public:
typedef typename base_type::ports_type ports_type; typedef typename base_type::output_ports_type output_ports_type;
private: private:
struct splitting_body { struct splitting_body {
void operator()(const TupleType& t, ports_type &p) { void operator()(const TupleType& t, output_ports_type &p) {
internal::emit_element<N>::emit_this(t, p); internal::emit_element<N>::emit_this(t, p);
} }
}; };
public: public:
typedef TupleType input_type; typedef TupleType input_type;
typedef Allocator allocator_type; typedef Allocator allocator_type;
split_node(graph &g) : base_type(g, unlimited, splitting_body()) { } split_node(graph &g) : base_type(g, unlimited, splitting_body()) {}
split_node( const split_node & other) : base_type(other) { } split_node( const split_node & other) : base_type(other) {}
}; };
#endif // TBB_PREVIEW_GRAPH_NODES
//! Implements an executable node that supports continue_msg -> Output //! Implements an executable node that supports continue_msg -> Output
template <typename Output> template <typename Output>
class continue_node : public graph_node, public internal::continue_input<Ou tput>, public internal::function_output<Output> { class continue_node : public graph_node, public internal::continue_input<Ou tput>, public internal::function_output<Output> {
using graph_node::my_graph;
public: public:
typedef continue_msg input_type; typedef continue_msg input_type;
typedef Output output_type; typedef Output output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
typedef internal::function_output<output_type> fOutput_type; typedef internal::function_output<output_type> fOutput_type;
//! Constructor for executable node with continue_msg -> Output //! Constructor for executable node with continue_msg -> Output
template <typename Body > template <typename Body >
continue_node( graph &g, Body body ) continue_node( graph &g, Body body ) :
: internal::continue_input<output_type>( g, body ) { graph_node(g), internal::continue_input<output_type>( g, body )
} {}
//! Constructor for executable node with continue_msg -> Output //! Constructor for executable node with continue_msg -> Output
template <typename Body > template <typename Body >
continue_node( graph &g, int number_of_predecessors, Body body ) continue_node( graph &g, int number_of_predecessors, Body body ) :
: internal::continue_input<output_type>( g, number_of_predecessors, graph_node(g), internal::continue_input<output_type>( g, number_of_
body ) predecessors, body )
{ {}
}
//! Copy constructor //! Copy constructor
continue_node( const continue_node& src ) : continue_node( const continue_node& src ) :
graph_node(), internal::continue_input<output_type>(src), graph_node(src.my_graph), internal::continue_input<output_type>(src
internal::function_output<Output>() { } ),
internal::function_output<Output>()
{}
protected: protected:
/* override */ internal::broadcast_cache<output_type> &successors () { return fOutput_type::my_successors; } /* override */ internal::broadcast_cache<output_type> &successors () { return fOutput_type::my_successors; }
}; };
template< typename T > template< typename T >
class overwrite_node : public graph_node, public receiver<T>, public sender <T> { class overwrite_node : public graph_node, public receiver<T>, public sender <T> {
using graph_node::my_graph;
public: public:
typedef T input_type; typedef T input_type;
typedef T output_type; typedef T output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
overwrite_node() : my_buffer_is_valid(false) { overwrite_node(graph &g) : graph_node(g), my_buffer_is_valid(false) {
my_successors.set_owner( this ); my_successors.set_owner( this );
} }
// Copy constructor; doesn't take anything from src; default won't work // Copy constructor; doesn't take anything from src; default won't work
overwrite_node( const overwrite_node& ) : overwrite_node( const overwrite_node& src ) :
graph_node(), receiver<T>(), sender<T>(), my_buffer_is_valid(false) graph_node(src.my_graph), receiver<T>(), sender<T>(), my_buffer_is_
{ valid(false)
{
my_successors.set_owner( this ); my_successors.set_owner( this );
} }
~overwrite_node() {} ~overwrite_node() {}
/* override */ bool register_successor( successor_type &s ) { /* override */ bool register_successor( successor_type &s ) {
spin_mutex::scoped_lock l( my_mutex ); spin_mutex::scoped_lock l( my_mutex );
if ( my_buffer_is_valid ) { if ( my_buffer_is_valid ) {
// We have a valid value that must be forwarded immediately. // We have a valid value that must be forwarded immediately.
if ( s.try_put( my_buffer ) || !s.register_predecessor( *this ) ) { if ( s.try_put( my_buffer ) || !s.register_predecessor( *this ) ) {
skipping to change at line 708 skipping to change at line 875
spin_mutex::scoped_lock l( my_mutex ); spin_mutex::scoped_lock l( my_mutex );
return my_buffer_is_valid; return my_buffer_is_valid;
} }
void clear() { void clear() {
spin_mutex::scoped_lock l( my_mutex ); spin_mutex::scoped_lock l( my_mutex );
my_buffer_is_valid = false; my_buffer_is_valid = false;
} }
protected: protected:
spin_mutex my_mutex; spin_mutex my_mutex;
internal::broadcast_cache< T, null_rw_mutex > my_successors; internal::broadcast_cache< T, null_rw_mutex > my_successors;
T my_buffer; T my_buffer;
bool my_buffer_is_valid; bool my_buffer_is_valid;
}; };
template< typename T > template< typename T >
class write_once_node : public overwrite_node<T> { class write_once_node : public overwrite_node<T> {
public: public:
typedef T input_type; typedef T input_type;
typedef T output_type; typedef T output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
//! Constructor //! Constructor
write_once_node() : overwrite_node<T>() {} write_once_node(graph& g) : overwrite_node<T>(g) {}
//! Copy constructor: call base class copy constructor //! Copy constructor: call base class copy constructor
write_once_node( const write_once_node& src ) : overwrite_node<T>(src) {} write_once_node( const write_once_node& src ) : overwrite_node<T>(src) {}
/* override */ bool try_put( const T &v ) { /* override */ bool try_put( const T &v ) {
spin_mutex::scoped_lock l( this->my_mutex ); spin_mutex::scoped_lock l( this->my_mutex );
if ( this->my_buffer_is_valid ) { if ( this->my_buffer_is_valid ) {
return false; return false;
} else { } else {
this->my_buffer = v; this->my_buffer = v;
this->my_buffer_is_valid = true; this->my_buffer_is_valid = true;
this->my_successors.try_put(v); this->my_successors.try_put(v);
return true; return true;
} }
} }
}; };
//! Forwards messages of type T to all successors //! Forwards messages of type T to all successors
template <typename T> template <typename T>
class broadcast_node : public graph_node, public receiver<T>, public sender <T> { class broadcast_node : public graph_node, public receiver<T>, public sender <T> {
using graph_node::my_graph;
internal::broadcast_cache<T> my_successors; internal::broadcast_cache<T> my_successors;
public: public:
typedef T input_type; typedef T input_type;
typedef T output_type; typedef T output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
broadcast_node( ) { broadcast_node(graph& g) : graph_node(g) {
my_successors.set_owner( this ); my_successors.set_owner( this );
} }
// Copy constructor // Copy constructor
broadcast_node( const broadcast_node& ) : graph_node(), receiver<T>(), broadcast_node( const broadcast_node& src ) :
sender<T>() { graph_node(src.my_graph), receiver<T>(), sender<T>()
{
my_successors.set_owner( this ); my_successors.set_owner( this );
} }
//! Adds a successor //! Adds a successor
virtual bool register_successor( receiver<T> &r ) { virtual bool register_successor( receiver<T> &r ) {
my_successors.register_successor( r ); my_successors.register_successor( r );
return true; return true;
} }
//! Removes s as a successor //! Removes s as a successor
virtual bool remove_successor( receiver<T> &r ) { virtual bool remove_successor( receiver<T> &r ) {
my_successors.remove_successor( r ); my_successors.remove_successor( r );
return true; return true;
} }
/* override */ bool try_put( const T &t ) { /* override */ bool try_put( const T &t ) {
my_successors.try_put(t); my_successors.try_put(t);
return true; return true;
} }
}; };
#include "internal/_flow_graph_item_buffer_impl.h" #include "internal/_flow_graph_item_buffer_impl.h"
//! Forwards messages in arbitrary order //! Forwards messages in arbitrary order
template <typename T, typename A=cache_aligned_allocator<T> > template <typename T, typename A=cache_aligned_allocator<T> >
class buffer_node : public graph_node, public reservable_item_buffer<T, A>, public receiver<T>, public sender<T> { class buffer_node : public graph_node, public reservable_item_buffer<T, A>, public receiver<T>, public sender<T> {
using graph_node::my_graph;
public: public:
typedef T input_type; typedef T input_type;
typedef T output_type; typedef T output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
typedef buffer_node<T, A> my_class; typedef buffer_node<T, A> my_class;
protected: protected:
typedef size_t size_type; typedef size_t size_type;
internal::round_robin_cache< T, null_rw_mutex > my_successors; internal::round_robin_cache< T, null_rw_mutex > my_successors;
skipping to change at line 925 skipping to change at line 1089
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
} }
virtual void internal_release(buffer_operation *op) { virtual void internal_release(buffer_operation *op) {
this->release_front(); this->release_front();
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
} }
public: public:
//! Constructor //! Constructor
buffer_node( graph &g ) : reservable_item_buffer<T>(), buffer_node( graph &g ) : graph_node(g), reservable_item_buffer<T>(),
my_parent( g.root_task() ), forwarder_busy(false) { my_parent( g.root_task() ), forwarder_busy(false) {
my_successors.set_owner(this); my_successors.set_owner(this);
my_aggregator.initialize_handler(my_handler(this)); my_aggregator.initialize_handler(my_handler(this));
} }
//! Copy constructor //! Copy constructor
buffer_node( const buffer_node& src ) : buffer_node( const buffer_node& src ) : graph_node(src.my_graph),
graph_node(), reservable_item_buffer<T>(), receiver<T>(), sender<T> reservable_item_buffer<T>(), receiver<T>(), sender<T>(),
(),
my_parent( src.my_parent ) { my_parent( src.my_parent ) {
forwarder_busy = false; forwarder_busy = false;
my_successors.set_owner(this); my_successors.set_owner(this);
my_aggregator.initialize_handler(my_handler(this)); my_aggregator.initialize_handler(my_handler(this));
} }
virtual ~buffer_node() {} virtual ~buffer_node() {}
// //
// message sender implementation // message sender implementation
skipping to change at line 1015 skipping to change at line 1179
buffer_operation op_data(t, put_item); buffer_operation op_data(t, put_item);
my_aggregator.execute(&op_data); my_aggregator.execute(&op_data);
return true; return true;
} }
}; };
//! Forwards messages in FIFO order //! Forwards messages in FIFO order
template <typename T, typename A=cache_aligned_allocator<T> > template <typename T, typename A=cache_aligned_allocator<T> >
class queue_node : public buffer_node<T, A> { class queue_node : public buffer_node<T, A> {
protected: protected:
typedef typename buffer_node<T, A>::size_type size_type; typedef typename buffer_node<T, A>::size_type size_type;
typedef typename buffer_node<T, A>::buffer_operation queue_operation; typedef typename buffer_node<T, A>::buffer_operation queue_operation;
enum op_stat {WAIT=0, SUCCEEDED, FAILED}; enum op_stat {WAIT=0, SUCCEEDED, FAILED};
//! Tries to forward valid items to successors //! Tries to forward valid items to successors
/* override */ void internal_forward(queue_operation *op) { /* override */ void internal_forward(queue_operation *op) {
T i_copy; T i_copy;
bool success = false; // flagged when a successor accepts bool success = false; // flagged when a successor accepts
size_type counter = this->my_successors.size(); size_type counter = this->my_successors.size();
if (this->my_reserved || !this->item_valid(this->my_head)){ if (this->my_reserved || !this->item_valid(this->my_head)) {
__TBB_store_with_release(op->status, FAILED); __TBB_store_with_release(op->status, FAILED);
this->forwarder_busy = false; this->forwarder_busy = false;
return; return;
} }
// Keep trying to send items while there is at least one accepting successor // Keep trying to send items while there is at least one accepting successor
while (counter>0 && this->item_valid(this->my_head)) { while (counter>0 && this->item_valid(this->my_head)) {
this->fetch_front(i_copy); this->fetch_front(i_copy);
if(this->my_successors.try_put(i_copy)) { if(this->my_successors.try_put(i_copy)) {
this->invalidate_front(); this->invalidate_front();
++(this->my_head); ++(this->my_head);
skipping to change at line 1074 skipping to change at line 1238
this->invalidate_front(); this->invalidate_front();
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
} }
} }
/* override */ void internal_consume(queue_operation *op) { /* override */ void internal_consume(queue_operation *op) {
this->consume_front(); this->consume_front();
__TBB_store_with_release(op->status, SUCCEEDED); __TBB_store_with_release(op->status, SUCCEEDED);
} }
public: public:
typedef T input_type; typedef T input_type;
typedef T output_type; typedef T output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
//! Constructor //! Constructor
queue_node( graph &g ) : buffer_node<T, A>(g) {} queue_node( graph &g ) : buffer_node<T, A>(g) {}
//! Copy constructor //! Copy constructor
queue_node( const queue_node& src) : buffer_node<T, A>(src) {} queue_node( const queue_node& src) : buffer_node<T, A>(src) {}
}; };
//! Forwards messages in sequence order //! Forwards messages in sequence order
template< typename T, typename A=cache_aligned_allocator<T> > template< typename T, typename A=cache_aligned_allocator<T> >
class sequencer_node : public queue_node<T, A> { class sequencer_node : public queue_node<T, A> {
internal::function_body< T, size_t > *my_sequencer; internal::function_body< T, size_t > *my_sequencer;
public: public:
typedef T input_type; typedef T input_type;
typedef T output_type; typedef T output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
//! Constructor //! Constructor
template< typename Sequencer > template< typename Sequencer >
sequencer_node( graph &g, const Sequencer& s ) : queue_node<T, A>(g), sequencer_node( graph &g, const Sequencer& s ) : queue_node<T, A>(g),
my_sequencer(new internal::function_body_leaf< T, size_t, Sequencer >(s) ) {} my_sequencer(new internal::function_body_leaf< T, size_t, Sequencer >(s) ) {}
skipping to change at line 1315 skipping to change at line 1477
this->my_array[cur_pos].first = this->my_array[this->my_tail].first ; this->my_array[cur_pos].first = this->my_array[this->my_tail].first ;
} }
}; };
//! Forwards messages only if the threshold has not been reached //! Forwards messages only if the threshold has not been reached
/** This node forwards items until its threshold is reached. /** This node forwards items until its threshold is reached.
It contains no buffering. If the downstream node rejects, the It contains no buffering. If the downstream node rejects, the
message is dropped. */ message is dropped. */
template< typename T > template< typename T >
class limiter_node : public graph_node, public receiver< T >, public sender < T > { class limiter_node : public graph_node, public receiver< T >, public sender < T > {
using graph_node::my_graph;
public: public:
typedef T input_type; typedef T input_type;
typedef T output_type; typedef T output_type;
typedef sender< input_type > predecessor_type; typedef sender< input_type > predecessor_type;
typedef receiver< output_type > successor_type; typedef receiver< output_type > successor_type;
private: private:
task *my_root_task; task *my_root_task;
size_t my_threshold; size_t my_threshold;
size_t my_count; size_t my_count;
internal::predecessor_cache< T > my_predecessors; internal::predecessor_cache< T > my_predecessors;
spin_mutex my_mutex; spin_mutex my_mutex;
internal::broadcast_cache< T > my_successors; internal::broadcast_cache< T > my_successors;
int init_decrement_predecessors; int init_decrement_predecessors;
friend class internal::forward_task< limiter_node<T> >; friend class internal::forward_task< limiter_node<T> >;
skipping to change at line 1363 skipping to change at line 1524
spin_mutex::scoped_lock lock(my_mutex); spin_mutex::scoped_lock lock(my_mutex);
if ( my_count < my_threshold ) if ( my_count < my_threshold )
++my_count; ++my_count;
else else
return; return;
} }
decrement_counter(); decrement_counter();
} }
public: public:
//! The internal receiver< continue_msg > that decrements the count //! The internal receiver< continue_msg > that decrements the count
internal::decrementer< limiter_node<T> > decrement; internal::decrementer< limiter_node<T> > decrement;
//! Constructor //! Constructor
limiter_node(graph &g, size_t threshold, int num_decrement_predecessors =0) : limiter_node(graph &g, size_t threshold, int num_decrement_predecessors =0) :
my_root_task(g.root_task()), my_threshold(threshold), my_count(0), graph_node(g), my_root_task(g.root_task()), my_threshold(threshold) , my_count(0),
init_decrement_predecessors(num_decrement_predecessors), init_decrement_predecessors(num_decrement_predecessors),
decrement(num_decrement_predecessors) decrement(num_decrement_predecessors)
{ {
my_predecessors.set_owner(this); my_predecessors.set_owner(this);
my_successors.set_owner(this); my_successors.set_owner(this);
decrement.set_owner(this); decrement.set_owner(this);
} }
//! Copy constructor //! Copy constructor
limiter_node( const limiter_node& src ) : limiter_node( const limiter_node& src ) :
graph_node(), receiver<T>(), sender<T>(), graph_node(src.my_graph), receiver<T>(), sender<T>(),
my_root_task(src.my_root_task), my_threshold(src.my_threshold), my_ count(0), my_root_task(src.my_root_task), my_threshold(src.my_threshold), my_ count(0),
init_decrement_predecessors(src.init_decrement_predecessors), init_decrement_predecessors(src.init_decrement_predecessors),
decrement(src.init_decrement_predecessors) decrement(src.init_decrement_predecessors)
{ {
my_predecessors.set_owner(this); my_predecessors.set_owner(this);
my_successors.set_owner(this); my_successors.set_owner(this);
decrement.set_owner(this); decrement.set_owner(this);
} }
//! Replace the current successor with this new successor //! Replace the current successor with this new successor
skipping to change at line 1442 skipping to change at line 1602
task::enqueue( * new ( task::allocate_additional_child_of( *my_ root_task ) ) task::enqueue( * new ( task::allocate_additional_child_of( *my_ root_task ) )
internal::forward_task< limiter_node<T> >( *this ) ); internal::forward_task< limiter_node<T> >( *this ) );
return true; return true;
} }
//! Removes src from the list of cached predecessors. //! Removes src from the list of cached predecessors.
/* override */ bool remove_predecessor( predecessor_type &src ) { /* override */ bool remove_predecessor( predecessor_type &src ) {
my_predecessors.remove( src ); my_predecessors.remove( src );
return true; return true;
} }
}; };
#include "internal/_flow_graph_join_impl.h" #include "internal/_flow_graph_join_impl.h"
using internal::reserving_port; using internal::reserving_port;
using internal::queueing_port; using internal::queueing_port;
using internal::tag_matching_port; using internal::tag_matching_port;
using internal::input_port; using internal::input_port;
using internal::tag_value; using internal::tag_value;
using internal::NO_TAG; using internal::NO_TAG;
template<typename OutputTuple, graph_buffer_policy JP=queueing> class join_ node; template<typename OutputTuple, graph_buffer_policy JP=queueing> class join_ node;
template<typename OutputTuple> template<typename OutputTuple>
class join_node<OutputTuple,reserving>: public internal::unfolded_join_node <std::tuple_size<OutputTuple>::value, reserving_port, OutputTuple, reservin g> { class join_node<OutputTuple,reserving>: public internal::unfolded_join_node <std::tuple_size<OutputTuple>::value, reserving_port, OutputTuple, reservin g> {
private: private:
static const int N = std::tuple_size<OutputTuple>::value; static const int N = std::tuple_size<OutputTuple>::value;
typedef typename internal::unfolded_join_node<N, reserving_port, Output Tuple, reserving> unfolded_type; typedef typename internal::unfolded_join_node<N, reserving_port, Output Tuple, reserving> unfolded_type;
public: public:
typedef OutputTuple output_type; typedef OutputTuple output_type;
typedef typename unfolded_type::input_ports_tuple_type input_ports_tupl e_type; typedef typename unfolded_type::input_ports_type input_ports_type;
join_node(graph &g) : unfolded_type(g) { } join_node(graph &g) : unfolded_type(g) { }
join_node(const join_node &other) : unfolded_type(other) {} join_node(const join_node &other) : unfolded_type(other) {}
}; };
template<typename OutputTuple> template<typename OutputTuple>
class join_node<OutputTuple,queueing>: public internal::unfolded_join_node< std::tuple_size<OutputTuple>::value, queueing_port, OutputTuple, queueing> { class join_node<OutputTuple,queueing>: public internal::unfolded_join_node< std::tuple_size<OutputTuple>::value, queueing_port, OutputTuple, queueing> {
private: private:
static const int N = std::tuple_size<OutputTuple>::value; static const int N = std::tuple_size<OutputTuple>::value;
typedef typename internal::unfolded_join_node<N, queueing_port, OutputT uple, queueing> unfolded_type; typedef typename internal::unfolded_join_node<N, queueing_port, OutputT uple, queueing> unfolded_type;
public: public:
typedef OutputTuple output_type; typedef OutputTuple output_type;
typedef typename unfolded_type::input_ports_tuple_type input_ports_tupl e_type; typedef typename unfolded_type::input_ports_type input_ports_type;
join_node(graph &g) : unfolded_type(g) { } join_node(graph &g) : unfolded_type(g) { }
join_node(const join_node &other) : unfolded_type(other) {} join_node(const join_node &other) : unfolded_type(other) {}
}; };
// template for tag_matching join_node // template for tag_matching join_node
template<typename OutputTuple> template<typename OutputTuple>
class join_node<OutputTuple, tag_matching> : public internal::unfolded_join _node<std::tuple_size<OutputTuple>::value, class join_node<OutputTuple, tag_matching> : public internal::unfolded_join _node<std::tuple_size<OutputTuple>::value,
tag_matching_port, OutputTuple, tag_matching> { tag_matching_port, OutputTuple, tag_matching> {
private: private:
static const int N = std::tuple_size<OutputTuple>::value; static const int N = std::tuple_size<OutputTuple>::value;
typedef typename internal::unfolded_join_node<N, tag_matching_port, Out putTuple, tag_matching> unfolded_type; typedef typename internal::unfolded_join_node<N, tag_matching_port, Out putTuple, tag_matching> unfolded_type;
public: public:
typedef OutputTuple output_type; typedef OutputTuple output_type;
typedef typename unfolded_type::input_ports_tuple_type input_ports_tupl e_type; typedef typename unfolded_type::input_ports_type input_ports_type;
template<typename B0, typename B1> template<typename B0, typename B1>
join_node(graph &g, B0 b0, B1 b1) : unfolded_type(g, b0, b1) { } join_node(graph &g, B0 b0, B1 b1) : unfolded_type(g, b0, b1) { }
template<typename B0, typename B1, typename B2> template<typename B0, typename B1, typename B2>
join_node(graph &g, B0 b0, B1 b1, B2 b2) : unfolded_type(g, b0, b1, b2) { } join_node(graph &g, B0 b0, B1 b1, B2 b2) : unfolded_type(g, b0, b1, b2) { }
template<typename B0, typename B1, typename B2, typename B3> template<typename B0, typename B1, typename B2, typename B3>
join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3) : unfolded_type(g, b0, b1, b2, b3) { } join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3) : unfolded_type(g, b0, b1, b2, b3) { }
template<typename B0, typename B1, typename B2, typename B3, typename B 4> template<typename B0, typename B1, typename B2, typename B3, typename B 4>
join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4) : unfolded_type( g, b0, b1, b2, b3, b4) { } join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4) : unfolded_type( g, b0, b1, b2, b3, b4) { }
template<typename B0, typename B1, typename B2, typename B3, typename B 4, typename B5> template<typename B0, typename B1, typename B2, typename B3, typename B 4, typename B5>
join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 b5) : unfolde d_type(g, b0, b1, b2, b3, b4, b5) { } join_node(graph &g, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4, B5 b5) : unfolde d_type(g, b0, b1, b2, b3, b4, b5) { }
skipping to change at line 1522 skipping to change at line 1681
// or node // or node
#include "internal/_flow_graph_or_impl.h" #include "internal/_flow_graph_or_impl.h"
template<typename InputTuple> template<typename InputTuple>
class or_node : public internal::unfolded_or_node<InputTuple> { class or_node : public internal::unfolded_or_node<InputTuple> {
private: private:
static const int N = std::tuple_size<InputTuple>::value; static const int N = std::tuple_size<InputTuple>::value;
public: public:
typedef typename internal::or_output_type<InputTuple>::type output_type ; typedef typename internal::or_output_type<InputTuple>::type output_type ;
typedef typename internal::unfolded_or_node<InputTuple> unfolded_type; typedef typename internal::unfolded_or_node<InputTuple> unfolded_type;
or_node() : unfolded_type() { } or_node(graph& g) : unfolded_type(g) { }
// Copy constructor // Copy constructor
or_node( const or_node& /*other*/ ) : unfolded_type() { } or_node( const or_node& other ) : unfolded_type(other) { }
}; };
#endif // TBB_PREVIEW_GRAPH_NODES #endif // TBB_PREVIEW_GRAPH_NODES
//! Makes an edge between a single predecessor and a single successor //! Makes an edge between a single predecessor and a single successor
template< typename T > template< typename T >
inline void make_edge( sender<T> &p, receiver<T> &s ) { inline void make_edge( sender<T> &p, receiver<T> &s ) {
p.register_successor( s ); p.register_successor( s );
} }
//! Makes an edge between a single predecessor and a single successor //! Makes an edge between a single predecessor and a single successor
skipping to change at line 1557 skipping to change at line 1716
using interface6::graph; using interface6::graph;
using interface6::graph_node; using interface6::graph_node;
using interface6::continue_msg; using interface6::continue_msg;
using interface6::sender; using interface6::sender;
using interface6::receiver; using interface6::receiver;
using interface6::continue_receiver; using interface6::continue_receiver;
using interface6::source_node; using interface6::source_node;
using interface6::function_node; using interface6::function_node;
#if TBB_PREVIEW_GRAPH_NODES using interface6::multifunction_node;
using interface6::multioutput_function_node;
using interface6::split_node; using interface6::split_node;
using interface6::internal::output_port; using interface6::internal::output_port;
#if TBB_PREVIEW_GRAPH_NODES
using interface6::or_node; using interface6::or_node;
#endif #endif
using interface6::continue_node; using interface6::continue_node;
using interface6::overwrite_node; using interface6::overwrite_node;
using interface6::write_once_node; using interface6::write_once_node;
using interface6::broadcast_node; using interface6::broadcast_node;
using interface6::buffer_node; using interface6::buffer_node;
using interface6::queue_node; using interface6::queue_node;
using interface6::sequencer_node; using interface6::sequencer_node;
using interface6::priority_queue_node; using interface6::priority_queue_node;
 End of changes. 104 change blocks. 
128 lines changed or deleted 290 lines changed or added


 gcc_generic.h   gcc_generic.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 38 skipping to change at line 38
#if !defined(__TBB_machine_H) || defined(__TBB_machine_gcc_generic_H) #if !defined(__TBB_machine_H) || defined(__TBB_machine_gcc_generic_H)
#error Do not #include this internal file directly; use public TBB headers instead. #error Do not #include this internal file directly; use public TBB headers instead.
#endif #endif
#define __TBB_machine_gcc_generic_H #define __TBB_machine_gcc_generic_H
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <unistd.h>
#define __TBB_WORDSIZE __SIZEOF_INT__ #define __TBB_WORDSIZE __SIZEOF_POINTER__
// For some reason straight mapping does not work on mingw // For some reason straight mapping does not work on mingw
#if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__ #if __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
#define __TBB_BIG_ENDIAN 0 #define __TBB_BIG_ENDIAN 0
#elif __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ #elif __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__
#define __TBB_BIG_ENDIAN 1 #define __TBB_BIG_ENDIAN 1
#else #else
#error Unsupported endianness #error Unsupported endianness
#endif #endif
skipping to change at line 63 skipping to change at line 63
consider forking it and relaxing below helpers as appropriate. **/ consider forking it and relaxing below helpers as appropriate. **/
#define __TBB_acquire_consistency_helper() __sync_synchronize() #define __TBB_acquire_consistency_helper() __sync_synchronize()
#define __TBB_release_consistency_helper() __sync_synchronize() #define __TBB_release_consistency_helper() __sync_synchronize()
#define __TBB_full_memory_fence() __sync_synchronize() #define __TBB_full_memory_fence() __sync_synchronize()
#define __TBB_control_consistency_helper() __sync_synchronize() #define __TBB_control_consistency_helper() __sync_synchronize()
#define __TBB_MACHINE_DEFINE_ATOMICS(S,T) \ #define __TBB_MACHINE_DEFINE_ATOMICS(S,T) \
inline T __TBB_machine_cmpswp##S( volatile void *ptr, T value, T comparand ) { \ inline T __TBB_machine_cmpswp##S( volatile void *ptr, T value, T comparand ) { \
return __sync_val_compare_and_swap(reinterpret_cast<volatile T *>(ptr), comparand,value); \ return __sync_val_compare_and_swap(reinterpret_cast<volatile T *>(ptr), comparand,value); \
} \ } \
\
inline T __TBB_machine_fetchadd##S( volatile void *ptr, T value ) {
\
return __sync_fetch_and_add(reinterpret_cast<volatile T *>(ptr),value);
\
}
\
__TBB_MACHINE_DEFINE_ATOMICS(1,int8_t) __TBB_MACHINE_DEFINE_ATOMICS(1,int8_t)
__TBB_MACHINE_DEFINE_ATOMICS(2,int16_t) __TBB_MACHINE_DEFINE_ATOMICS(2,int16_t)
__TBB_MACHINE_DEFINE_ATOMICS(4,int32_t) __TBB_MACHINE_DEFINE_ATOMICS(4,int32_t)
__TBB_MACHINE_DEFINE_ATOMICS(8,int64_t) __TBB_MACHINE_DEFINE_ATOMICS(8,int64_t)
#undef __TBB_MACHINE_DEFINE_ATOMICS #undef __TBB_MACHINE_DEFINE_ATOMICS
#define __TBB_USE_GENERIC_FETCH_ADD 1 namespace tbb{ namespace internal { namespace gcc_builtins {
int clz(unsigned int x){ return __builtin_clz(x);};
int clz(unsigned long int x){ return __builtin_clzl(x);};
}}}
//gcc __builtin_clz builtin count _number_ of leading zeroes
static inline intptr_t __TBB_machine_lg( uintptr_t x ) {
return sizeof(x)*8 - tbb::internal::gcc_builtins::clz(x) -1 ;
}
static inline void __TBB_machine_or( volatile void *ptr, uintptr_t addend )
{
__sync_fetch_and_or(reinterpret_cast<volatile uintptr_t *>(ptr),addend)
;
}
static inline void __TBB_machine_and( volatile void *ptr, uintptr_t addend
) {
__sync_fetch_and_and(reinterpret_cast<volatile uintptr_t *>(ptr),addend
);
}
typedef unsigned char __TBB_Flag;
typedef __TBB_atomic __TBB_Flag __TBB_atomic_flag;
inline bool __TBB_machine_try_lock_byte( __TBB_atomic_flag &flag ) {
return __sync_lock_test_and_set(&flag,1)==0;
}
inline void __TBB_machine_unlock_byte( __TBB_atomic_flag &flag , __TBB_Flag
) {
__sync_lock_release(&flag);
}
// Machine specific atomic operations
#define __TBB_AtomicOR(P,V) __TBB_machine_or(P,V)
#define __TBB_AtomicAND(P,V) __TBB_machine_and(P,V)
#define __TBB_TryLockByte __TBB_machine_try_lock_byte
#define __TBB_UnlockByte __TBB_machine_unlock_byte
// Definition of other functions
#define __TBB_Log2(V) __TBB_machine_lg(V)
#define __TBB_USE_GENERIC_FETCH_STORE 1 #define __TBB_USE_GENERIC_FETCH_STORE 1
#define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
#define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1 #define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1
#if __TBB_WORDSIZE==4
#define __TBB_USE_GENERIC_DWORD_LOAD_STORE 1
#endif
 End of changes. 5 change blocks. 
3 lines changed or deleted 54 lines changed or added


 ibm_aix51.h   ibm_aix51.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 index.html   index.html 
skipping to change at line 16 skipping to change at line 16
<H2>Directories</H2> <H2>Directories</H2>
<DL> <DL>
<DT><A HREF="tbb/index.html">tbb</A> <DT><A HREF="tbb/index.html">tbb</A>
<DD>Include files for Threading Building Blocks classes and functions. <DD>Include files for Threading Building Blocks classes and functions.
</DL> </DL>
<HR> <HR>
<A HREF="../index.html">Up to parent directory</A> <A HREF="../index.html">Up to parent directory</A>
<p></p> <p></p>
Copyright &copy; 2005-2011 Intel Corporation. All Rights Reserved. Copyright &copy; 2005-2012 Intel Corporation. All Rights Reserved.
<P></P> <P></P>
Intel is a registered trademark or trademark of Intel Corporation Intel is a registered trademark or trademark of Intel Corporation
or its subsidiaries in the United States and other countries. or its subsidiaries in the United States and other countries.
<p></p> <p></p>
* Other names and brands may be claimed as the property of others. * Other names and brands may be claimed as the property of others.
</BODY> </BODY>
</HTML> </HTML>
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 linux_common.h   linux_common.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 linux_ia32.h   linux_ia32.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 linux_ia64.h   linux_ia64.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 linux_intel64.h   linux_intel64.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 mac_ppc.h   mac_ppc.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 macos_common.h   macos_common.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 memory_pool.h   memory_pool.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 213 skipping to change at line 213
//! construct pool with underlying allocator //! construct pool with underlying allocator
inline fixed_pool(void *buf, size_t size); inline fixed_pool(void *buf, size_t size);
//! destroy pool //! destroy pool
~fixed_pool() { destroy(); } ~fixed_pool() { destroy(); }
}; };
//////////////// Implementation /////////////// //////////////// Implementation ///////////////
template <typename Alloc> template <typename Alloc>
memory_pool<Alloc>::memory_pool(const Alloc &src) : my_alloc(src) { memory_pool<Alloc>::memory_pool(const Alloc &src) : my_alloc(src) {
rml::MemPoolPolicy args = { rml::MemPoolPolicy args(allocate_request, deallocate_request,
allocate_request, deallocate_request, sizeof(typename Alloc::value_ sizeof(typename Alloc::value_type));
type) rml::MemPoolError res = rml::pool_create_v1(intptr_t(this), &args, &my_
}; pool);
my_pool = rml::pool_create(intptr_t(this), &args); if( res!=rml::POOL_OK ) __TBB_THROW(std::bad_alloc());
__TBBMALLOC_ASSERT(my_pool, "Pool is not created");
if( !my_pool ) __TBB_THROW(std::bad_alloc());
} }
template <typename Alloc> template <typename Alloc>
void *memory_pool<Alloc>::allocate_request(intptr_t pool_id, size_t & bytes ) { void *memory_pool<Alloc>::allocate_request(intptr_t pool_id, size_t & bytes ) {
memory_pool<Alloc> &self = *reinterpret_cast<memory_pool<Alloc>*>(pool_ id); memory_pool<Alloc> &self = *reinterpret_cast<memory_pool<Alloc>*>(pool_ id);
const size_t unit_size = sizeof(typename Alloc::value_type); const size_t unit_size = sizeof(typename Alloc::value_type);
__TBBMALLOC_ASSERT( 0 == bytes%unit_size, NULL); __TBBMALLOC_ASSERT( 0 == bytes%unit_size, NULL);
void *ptr; void *ptr;
__TBB_TRY { ptr = self.my_alloc.allocate( bytes/unit_size ); } __TBB_TRY { ptr = self.my_alloc.allocate( bytes/unit_size ); }
__TBB_CATCH(...) { return 0; } __TBB_CATCH(...) { return 0; }
return ptr; return ptr;
} }
template <typename Alloc> template <typename Alloc>
int memory_pool<Alloc>::deallocate_request(intptr_t pool_id, void* raw_ptr, size_t raw_bytes) { int memory_pool<Alloc>::deallocate_request(intptr_t pool_id, void* raw_ptr, size_t raw_bytes) {
memory_pool<Alloc> &self = *reinterpret_cast<memory_pool<Alloc>*>(pool_ id); memory_pool<Alloc> &self = *reinterpret_cast<memory_pool<Alloc>*>(pool_ id);
const size_t unit_size = sizeof(typename Alloc::value_type); const size_t unit_size = sizeof(typename Alloc::value_type);
__TBBMALLOC_ASSERT( 0 == raw_bytes%unit_size, NULL); __TBBMALLOC_ASSERT( 0 == raw_bytes%unit_size, NULL);
self.my_alloc.deallocate( static_cast<typename Alloc::value_type*>(raw_ ptr), raw_bytes/unit_size ); self.my_alloc.deallocate( static_cast<typename Alloc::value_type*>(raw_ ptr), raw_bytes/unit_size );
return 0; return 0;
} }
inline fixed_pool::fixed_pool(void *buf, size_t size) : my_buffer(buf), my_ size(size) { inline fixed_pool::fixed_pool(void *buf, size_t size) : my_buffer(buf), my_ size(size) {
rml::MemPoolPolicy args = { allocate_request, 0, size }; rml::MemPoolPolicy args(allocate_request, 0, size, /*fixedPool=*/true);
my_pool = rml::pool_create(intptr_t(this), &args); rml::MemPoolError res = rml::pool_create_v1(intptr_t(this), &args, &my_
__TBBMALLOC_ASSERT(my_pool, "Pool is not created"); pool);
if( !my_pool ) __TBB_THROW(std::bad_alloc()); if( res!=rml::POOL_OK ) __TBB_THROW(std::bad_alloc());
} }
inline void *fixed_pool::allocate_request(intptr_t pool_id, size_t & bytes) { inline void *fixed_pool::allocate_request(intptr_t pool_id, size_t & bytes) {
fixed_pool &self = *reinterpret_cast<fixed_pool*>(pool_id); fixed_pool &self = *reinterpret_cast<fixed_pool*>(pool_id);
if( bytes > self.my_size || !__TBB_CompareAndSwapW(&self.my_size, 0, (b ytes=self.my_size)) ) if( bytes > self.my_size || !__TBB_CompareAndSwapW(&self.my_size, 0, (b ytes=self.my_size)) )
return 0; // all the memory was given already return 0; // all the memory was given already
return self.my_buffer; return self.my_buffer;
} }
} //namespace interface6 } //namespace interface6
using interface6::memory_pool_allocator; using interface6::memory_pool_allocator;
 End of changes. 3 change blocks. 
12 lines changed or deleted 10 lines changed or added


 mutex.h   mutex.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 null_mutex.h   null_mutex.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 null_rw_mutex.h   null_rw_mutex.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parallel_do.h   parallel_do.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parallel_for.h   parallel_for.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parallel_for_each.h   parallel_for_each.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parallel_invoke.h   parallel_invoke.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parallel_reduce.h   parallel_reduce.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parallel_scan.h   parallel_scan.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parallel_sort.h   parallel_sort.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parallel_while.h   parallel_while.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 partitioner.h   partitioner.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 pipeline.h   pipeline.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 ppl.h   ppl.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 queuing_mutex.h   queuing_mutex.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 queuing_rw_mutex.h   queuing_rw_mutex.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 reader_writer_lock.h   reader_writer_lock.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 recursive_mutex.h   recursive_mutex.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 runtime_loader.h   runtime_loader.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 scalable_allocator.h   scalable_allocator.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 100 skipping to change at line 100
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif /* __cplusplus */ #endif /* __cplusplus */
#ifdef __cplusplus #ifdef __cplusplus
namespace rml { namespace rml {
class MemoryPool; class MemoryPool;
#define MEM_POLICY_DEFINED 1
typedef void *(*rawAllocType)(intptr_t pool_id, size_t &bytes); typedef void *(*rawAllocType)(intptr_t pool_id, size_t &bytes);
typedef int (*rawFreeType)(intptr_t pool_id, void* raw_ptr, size_t raw_by tes); typedef int (*rawFreeType)(intptr_t pool_id, void* raw_ptr, size_t raw_by tes);
/*
MemPoolPolicy extension must be compatible with such structure fields layou
t
struct MemPoolPolicy { struct MemPoolPolicy {
rawAllocType pAlloc; rawAllocType pAlloc;
rawFreeType pFree; rawFreeType pFree;
size_t granularity; // granularity of pAlloc allocations size_t granularity; // granularity of pAlloc allocations
void *pReserved; // reserved for future extensions
size_t szReserved; // size of pReserved data
}; };
*/
struct MemPoolPolicy {
enum {
VERSION = 1
};
rawAllocType pAlloc;
rawFreeType pFree;
// granularity of pAlloc allocations. 0 means default used
.
size_t granularity;
int version;
// all memory consumed at 1st pAlloc call and never return
ed,
// no more pAlloc calls after 1st
unsigned fixedPool : 1,
// memory consumed but returned only at pool termination
keepAllMemory : 1,
reserved : 30;
MemPoolPolicy(rawAllocType pAlloc_, rawFreeType pFree_,
size_t granularity_ = 0, bool fixedPool_ = false,
bool keepAllMemory_ = false) :
pAlloc(pAlloc_), pFree(pFree_), granularity(granularity_), version(
VERSION),
fixedPool(fixedPool_), keepAllMemory(keepAllMemory_),
reserved(0) {}
};
enum MemPoolError {
POOL_OK, // pool created successfully
INVALID_POLICY, // invalid policy parameters found
UNSUPPORTED_POLICY, // requested pool policy is not supported by alloca
tor library
NO_MEMORY // lack of memory during pool creation
};
MemPoolError pool_create_v1(intptr_t pool_id, const MemPoolPolicy *policy,
rml::MemoryPool **pool);
MemoryPool *pool_create(intptr_t pool_id, const MemPoolPolicy* memPoolPolic y);
bool pool_destroy(MemoryPool* memPool); bool pool_destroy(MemoryPool* memPool);
void *pool_malloc(MemoryPool* memPool, size_t size); void *pool_malloc(MemoryPool* memPool, size_t size);
void *pool_realloc(MemoryPool* memPool, void *object, size_t size); void *pool_realloc(MemoryPool* memPool, void *object, size_t size);
void *pool_aligned_malloc(MemoryPool* mPool, size_t size, size_t alignment)
;
void *pool_aligned_realloc(MemoryPool* mPool, void *ptr, size_t size, size_
t alignment);
bool pool_reset(MemoryPool* memPool); bool pool_reset(MemoryPool* memPool);
bool pool_free(MemoryPool *memPool, void *object); bool pool_free(MemoryPool *memPool, void *object);
} }
#include <new> /* To use new with the placement argument */ #include <new> /* To use new with the placement argument */
/* Ensure that including this header does not cause implicit linkage with T BB */ /* Ensure that including this header does not cause implicit linkage with T BB */
#ifndef __TBB_NO_IMPLICIT_LINKAGE #ifndef __TBB_NO_IMPLICIT_LINKAGE
#define __TBB_NO_IMPLICIT_LINKAGE 1 #define __TBB_NO_IMPLICIT_LINKAGE 1
#include "tbb_stddef.h" #include "tbb_stddef.h"
 End of changes. 7 change blocks. 
5 lines changed or deleted 49 lines changed or added


 spin_mutex.h   spin_mutex.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 spin_rw_mutex.h   spin_rw_mutex.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 sunos_sparc.h   sunos_sparc.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 task.h   task.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 task_group.h   task_group.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 task_scheduler_init.h   task_scheduler_init.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 task_scheduler_observer.h   task_scheduler_observer.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tbb.h   tbb.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tbb_allocator.h   tbb_allocator.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tbb_annotate.h   tbb_annotate.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tbb_config.h   tbb_config.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 60 skipping to change at line 60
with std::exception_ptr support appear. */ with std::exception_ptr support appear. */
#define __TBB_EXCEPTION_PTR_PRESENT ((_MSC_VER >= 1600 || (__GXX_EXPERIMEN TAL_CXX0X__ && __GNUC__==4 && __GNUC_MINOR__>=4)) && !__INTEL_COMPILER) #define __TBB_EXCEPTION_PTR_PRESENT ((_MSC_VER >= 1600 || (__GXX_EXPERIMEN TAL_CXX0X__ && __GNUC__==4 && __GNUC_MINOR__>=4)) && !__INTEL_COMPILER)
#if __GNUC__ || __SUNPRO_CC || __IBMCPP__ #if __GNUC__ || __SUNPRO_CC || __IBMCPP__
/* ICC defines __GNUC__ and so is covered */ /* ICC defines __GNUC__ and so is covered */
#define __TBB_ATTRIBUTE_ALIGNED_PRESENT 1 #define __TBB_ATTRIBUTE_ALIGNED_PRESENT 1
#elif _MSC_VER && (_MSC_VER >= 1300 || __INTEL_COMPILER) #elif _MSC_VER && (_MSC_VER >= 1300 || __INTEL_COMPILER)
#define __TBB_DECLSPEC_ALIGN_PRESENT 1 #define __TBB_DECLSPEC_ALIGN_PRESENT 1
#endif #endif
#if (__TBB_GCC_VERSION >= 40102) && !defined(__INTEL_COMPILER) /* TODO: change the version back to 4.1.2 once macro __TBB_WORD_SIZE become
optional */
#if (__TBB_GCC_VERSION >= 40306) && !defined(__INTEL_COMPILER)
/** built-in atomics available in GCC since 4.1.2 **/ /** built-in atomics available in GCC since 4.1.2 **/
#define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1 #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
#endif #endif
/** User controlled TBB features & modes **/ /** User controlled TBB features & modes **/
#ifndef TBB_USE_DEBUG #ifndef TBB_USE_DEBUG
#ifdef TBB_DO_ASSERT #ifdef TBB_DO_ASSERT
#define TBB_USE_DEBUG TBB_DO_ASSERT #define TBB_USE_DEBUG TBB_DO_ASSERT
#else #else
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 tbb_exception.h   tbb_exception.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tbb_machine.h   tbb_machine.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 804 skipping to change at line 804
if ( !__TBB_TryLockByte(flag) ) { if ( !__TBB_TryLockByte(flag) ) {
tbb::internal::atomic_backoff b; tbb::internal::atomic_backoff b;
do { do {
b.pause(); b.pause();
} while ( !__TBB_TryLockByte(flag) ); } while ( !__TBB_TryLockByte(flag) );
} }
return 0; return 0;
} }
#endif #endif
#ifndef __TBB_UnlockByte
#define __TBB_UnlockByte __TBB_store_with_release #define __TBB_UnlockByte __TBB_store_with_release
#endif
#ifndef __TBB_ReverseByte #ifndef __TBB_ReverseByte
inline unsigned char __TBB_ReverseByte(unsigned char src) { inline unsigned char __TBB_ReverseByte(unsigned char src) {
return tbb::internal::reverse<unsigned char>::byte_table[src]; return tbb::internal::reverse<unsigned char>::byte_table[src];
} }
#endif #endif
template<typename T> template<typename T>
T __TBB_ReverseBits(T src) { T __TBB_ReverseBits(T src) {
T dst; T dst;
 End of changes. 3 change blocks. 
1 lines changed or deleted 3 lines changed or added


 tbb_profiling.h   tbb_profiling.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tbb_stddef.h   tbb_stddef.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
skipping to change at line 37 skipping to change at line 37
*/ */
#ifndef __TBB_tbb_stddef_H #ifndef __TBB_tbb_stddef_H
#define __TBB_tbb_stddef_H #define __TBB_tbb_stddef_H
// Marketing-driven product version // Marketing-driven product version
#define TBB_VERSION_MAJOR 4 #define TBB_VERSION_MAJOR 4
#define TBB_VERSION_MINOR 0 #define TBB_VERSION_MINOR 0
// Engineering-focused interface version // Engineering-focused interface version
#define TBB_INTERFACE_VERSION 6002 #define TBB_INTERFACE_VERSION 6003
#define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000 #define TBB_INTERFACE_VERSION_MAJOR TBB_INTERFACE_VERSION/1000
// The oldest major interface version still supported // The oldest major interface version still supported
// To be used in SONAME, manifests, etc. // To be used in SONAME, manifests, etc.
#define TBB_COMPATIBLE_INTERFACE_VERSION 2 #define TBB_COMPATIBLE_INTERFACE_VERSION 2
#define __TBB_STRING_AUX(x) #x #define __TBB_STRING_AUX(x) #x
#define __TBB_STRING(x) __TBB_STRING_AUX(x) #define __TBB_STRING(x) __TBB_STRING_AUX(x)
// We do not need defines below for resource processing on windows // We do not need defines below for resource processing on windows
skipping to change at line 143 skipping to change at line 143
#define __TBB_EXPORTED_FUNC #define __TBB_EXPORTED_FUNC
#define __TBB_EXPORTED_METHOD #define __TBB_EXPORTED_METHOD
#endif #endif
#include <cstddef> /* Need size_t and ptrdiff_t */ #include <cstddef> /* Need size_t and ptrdiff_t */
#if _MSC_VER #if _MSC_VER
#define __TBB_tbb_windef_H #define __TBB_tbb_windef_H
#include "internal/_tbb_windef.h" #include "internal/_tbb_windef.h"
#undef __TBB_tbb_windef_H #undef __TBB_tbb_windef_H
#else #endif
#if !defined(_MSC_VER) || _MSC_VER>=1600
#include <stdint.h> #include <stdint.h>
#endif #endif
//! The namespace tbb contains all components of the library. //! The namespace tbb contains all components of the library.
namespace tbb { namespace tbb {
#if _MSC_VER #if _MSC_VER && _MSC_VER<1600
namespace internal { namespace internal {
typedef __int8 int8_t; typedef __int8 int8_t;
typedef __int16 int16_t; typedef __int16 int16_t;
typedef __int32 int32_t; typedef __int32 int32_t;
typedef __int64 int64_t; typedef __int64 int64_t;
typedef unsigned __int8 uint8_t; typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
} // namespace internal } // namespace internal
 End of changes. 4 change blocks. 
4 lines changed or deleted 5 lines changed or added


 tbb_thread.h   tbb_thread.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tbbmalloc_proxy.h   tbbmalloc_proxy.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 thread   thread 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tick_count.h   tick_count.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 tuple   tuple 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 windows_api.h   windows_api.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 windows_ia32.h   windows_ia32.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 windows_intel64.h   windows_intel64.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 xbox360_ppc.h   xbox360_ppc.h 
/* /*
Copyright 2005-2011 Intel Corporation. All Rights Reserved. Copyright 2005-2012 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. This file is part of Threading Building Blocks.
Threading Building Blocks is free software; you can redistribute it Threading Building Blocks is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License and/or modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation. version 2 as published by the Free Software Foundation.
Threading Building Blocks is distributed in the hope that it will be Threading Building Blocks is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/