_aggregator_impl.h   _aggregator_impl.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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_item_buffer_impl.h   _flow_graph_item_buffer_impl.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 854 skipping to change at line 854
}; };
typedef internal::aggregating_functor<my_class, tag_matching_FE_ope ration> my_handler; typedef internal::aggregating_functor<my_class, tag_matching_FE_ope ration> my_handler;
friend class internal::aggregating_functor<my_class, tag_matching_F E_operation>; friend class internal::aggregating_functor<my_class, tag_matching_F E_operation>;
aggregator<my_handler, tag_matching_FE_operation> my_aggregator; aggregator<my_handler, tag_matching_FE_operation> my_aggregator;
// called from aggregator, so serialized // called from aggregator, so serialized
// construct as many output objects as possible. // construct as many output objects as possible.
// returns a task pointer if the a task would have been enqueued bu t we asked that // returns a task pointer if the a task would have been enqueued bu t we asked that
// it be returned. Otherwise returns NULL. // it be returned. Otherwise returns NULL.
task * fill_output_buffer(bool should_enqueue, bool handle_task) { task * fill_output_buffer(tag_value t, bool should_enqueue, bool ha ndle_task) {
output_type l_out; output_type l_out;
task *rtask = NULL; task *rtask = NULL;
task* tp = this->my_graph_ptr->root_task(); task* tp = this->my_graph_ptr->root_task();
bool do_fwd = should_enqueue && this->buffer_empty() && tp; bool do_fwd = should_enqueue && this->buffer_empty() && tp;
while(find_value_tag(this->current_tag,N)) { // while there ar this->current_tag = t;
e completed items this->tagged_delete(this->current_tag); // remove the tag
this->tagged_delete(this->current_tag); // remove the tag if(join_helper<N>::get_items(my_inputs, l_out)) { // <== call
if(join_helper<N>::get_items(my_inputs, l_out)) { // <== back
call back this->push_back(l_out);
this->push_back(l_out); if(do_fwd) { // we enqueue if receiving an item from prede
if(do_fwd) { // we enqueue if receiving an item from p cessor, not if successor asks for item
redecessor, not if successor asks for item rtask = new ( task::allocate_additional_child_of( *tp )
rtask = new ( task::allocate_additional_child_of( * )
tp ) ) forward_task_bypass<my_node_type>(*my_node);
forward_task_bypass<my_node_type>(*my_node); if(handle_task) {
if(handle_task) { FLOW_SPAWN(*rtask);
FLOW_SPAWN(*rtask); rtask = NULL;
rtask = NULL;
}
do_fwd = false;
} }
// retire the input values do_fwd = false;
join_helper<N>::reset_ports(my_inputs); // <== call b
ack
this->current_tag = NO_TAG;
}
else {
__TBB_ASSERT(false, "should have had something to push"
);
} }
// retire the input values
join_helper<N>::reset_ports(my_inputs); // <== call back
this->current_tag = NO_TAG;
}
else {
__TBB_ASSERT(false, "should have had something to push");
} }
return rtask; return rtask;
} }
void handle_operations(tag_matching_FE_operation* op_list) { void handle_operations(tag_matching_FE_operation* op_list) {
tag_matching_FE_operation *current; tag_matching_FE_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 res_count: // called from BE case res_count: // called from BE
{ {
output_type l_out; output_type l_out;
this->pop_front(l_out); // don't care about return ed value. this->pop_front(l_out); // don't care about return ed value.
// buffer as many tuples as we can make
(void)fill_output_buffer(true, true);
__TBB_store_with_release(current->status, SUCCEEDED ); __TBB_store_with_release(current->status, SUCCEEDED );
} }
break; break;
case inc_count: { // called from input ports case inc_count: { // called from input ports
size_t *p = 0; size_t *p = 0;
tag_value t = current->my_val; tag_value t = current->my_val;
bool do_enqueue = current->enqueue_task; bool do_enqueue = current->enqueue_task;
if(!(this->tagged_find_ref(t,p))) { if(!(this->tagged_find_ref(t,p))) {
this->tagged_insert(t, 0); this->tagged_insert(t, 0);
if(!(this->tagged_find_ref(t,p))) { if(!(this->tagged_find_ref(t,p))) {
__TBB_ASSERT(false, "should find tag after inserting it"); __TBB_ASSERT(false, "should find tag after inserting it");
} }
} }
if(++(*p) == size_t(N)) { if(++(*p) == size_t(N)) {
task *rtask = fill_output_buffer(true, do_enque ue); task *rtask = fill_output_buffer(t, true, do_en queue);
__TBB_ASSERT(!rtask || !do_enqueue, "task shoul d not be returned"); __TBB_ASSERT(!rtask || !do_enqueue, "task shoul d not be returned");
current->bypass_t = rtask; current->bypass_t = rtask;
} }
} }
__TBB_store_with_release(current->status, SUCCEEDED); __TBB_store_with_release(current->status, SUCCEEDED);
break; break;
case may_succeed: // called from BE case may_succeed: // called from BE
(void)fill_output_buffer(false, /*handle_task*/true); // handle_task not used
__TBB_store_with_release(current->status, this->buffer_ empty() ? FAILED : SUCCEEDED); __TBB_store_with_release(current->status, this->buffer_ empty() ? FAILED : SUCCEEDED);
break; break;
case try_make: // called from BE case try_make: // called from BE
if(this->buffer_empty()) { if(this->buffer_empty()) {
__TBB_store_with_release(current->status, FAILED); __TBB_store_with_release(current->status, FAILED);
} }
else { else {
this->fetch_front(*(current->my_output)); this->fetch_front(*(current->my_output));
__TBB_store_with_release(current->status, SUCCEEDED ); __TBB_store_with_release(current->status, SUCCEEDED );
} }
 End of changes. 8 change blocks. 
30 lines changed or deleted 23 lines changed or added


 _flow_graph_node_impl.h   _flow_graph_node_impl.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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_or_impl.h   _flow_graph_or_impl.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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_tagged_buffer_impl.h   _flow_graph_tagged_buffer_impl.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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_trace_impl.h   _flow_graph_trace_impl.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 _mutex_padding.h   _mutex_padding.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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_strings.h   _tbb_strings.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 _x86_eliding_mutex_impl.h   _x86_eliding_mutex_impl.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 _x86_rtm_rw_mutex_impl.h   _x86_rtm_rw_mutex_impl.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 aggregator.h   aggregator.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 308 skipping to change at line 308
//! Prepare enough segments for number of buckets //! Prepare enough segments for number of buckets
void reserve(size_type buckets) { void reserve(size_type buckets) {
if( !buckets-- ) return; if( !buckets-- ) return;
bool is_initial = !my_size; bool is_initial = !my_size;
for( size_type m = my_mask; buckets > m; m = my_mask ) for( size_type m = my_mask; buckets > m; m = my_mask )
enable_segment( segment_index_of( m+1 ), is_initial ); enable_segment( segment_index_of( m+1 ), is_initial );
} }
//! Swap hash_map_bases //! Swap hash_map_bases
void internal_swap(hash_map_base &table) { void internal_swap(hash_map_base &table) {
std::swap(this->my_mask, table.my_mask); using std::swap;
std::swap(this->my_size, table.my_size); swap(this->my_mask, table.my_mask);
swap(this->my_size, table.my_size);
for(size_type i = 0; i < embedded_buckets; i++) for(size_type i = 0; i < embedded_buckets; i++)
std::swap(this->my_embedded_segment[i].node_list, table.my_ embedded_segment[i].node_list); swap(this->my_embedded_segment[i].node_list, table.my_embed ded_segment[i].node_list);
for(size_type i = embedded_block; i < pointers_per_table; i++) for(size_type i = embedded_block; i < pointers_per_table; i++)
std::swap(this->my_table[i], table.my_table[i]); swap(this->my_table[i], table.my_table[i]);
} }
}; };
template<typename Iterator> template<typename Iterator>
class hash_map_range; class hash_map_range;
//! Meets requirements of a forward iterator for STL */ //! Meets requirements of a forward iterator for STL */
/** Value is either the T or const T type of the container. /** Value is either the T or const T type of the container.
@ingroup containers */ @ingroup containers */
template<typename Container, typename Value> template<typename Container, typename Value>
skipping to change at line 951 skipping to change at line 952
void internal_copy(I first, I last); void internal_copy(I first, I last);
//! Fast find when no concurrent erasure is used. For internal use insi de TBB only! //! Fast find when no concurrent erasure is used. For internal use insi de TBB only!
/** Return pointer to item with given key, or NULL if no such item exis ts. /** Return pointer to item with given key, or NULL if no such item exis ts.
Must not be called concurrently with erasure operations. */ Must not be called concurrently with erasure operations. */
const_pointer internal_fast_find( const Key& key ) const { const_pointer internal_fast_find( const Key& key ) const {
hashcode_t h = my_hash_compare.hash( key ); hashcode_t h = my_hash_compare.hash( key );
hashcode_t m = (hashcode_t) itt_load_word_with_acquire( my_mask ); hashcode_t m = (hashcode_t) itt_load_word_with_acquire( my_mask );
node *n; node *n;
restart: restart:
__TBB_ASSERT((m&(m+1))==0, NULL); __TBB_ASSERT((m&(m+1))==0, "data structure is invalid");
bucket *b = get_bucket( h & m ); bucket *b = get_bucket( h & m );
// TODO: actually, notification is unnecessary here, just hiding do uble-check // TODO: actually, notification is unnecessary here, just hiding do uble-check
if( itt_load_word_with_acquire(b->node_list) == internal::rehash_re q ) if( itt_load_word_with_acquire(b->node_list) == internal::rehash_re q )
{ {
bucket::scoped_t lock; bucket::scoped_t lock;
if( lock.try_acquire( b->mutex, /*write=*/true ) ) { if( lock.try_acquire( b->mutex, /*write=*/true ) ) {
if( b->node_list == internal::rehash_req) if( b->node_list == internal::rehash_req)
const_cast<concurrent_hash_map*>(this)->rehash_bucket( b, h & m ); //recursive rehashing const_cast<concurrent_hash_map*>(this)->rehash_bucket( b, h & m ); //recursive rehashing
} }
else lock.acquire( b->mutex, /*write=*/false ); else lock.acquire( b->mutex, /*write=*/false );
skipping to change at line 989 skipping to change at line 990
template<typename Key, typename T, typename HashCompare, typename A> template<typename Key, typename T, typename HashCompare, typename A>
bool concurrent_hash_map<Key,T,HashCompare,A>::lookup( bool op_insert, cons t Key &key, const T *t, const_accessor *result, bool write ) { bool concurrent_hash_map<Key,T,HashCompare,A>::lookup( bool op_insert, cons t Key &key, const T *t, const_accessor *result, bool write ) {
__TBB_ASSERT( !result || !result->my_node, NULL ); __TBB_ASSERT( !result || !result->my_node, NULL );
bool return_value; bool return_value;
hashcode_t const h = my_hash_compare.hash( key ); hashcode_t const h = my_hash_compare.hash( key );
hashcode_t m = (hashcode_t) itt_load_word_with_acquire( my_mask ); hashcode_t m = (hashcode_t) itt_load_word_with_acquire( my_mask );
segment_index_t grow_segment = 0; segment_index_t grow_segment = 0;
node *n, *tmp_n = 0; node *n, *tmp_n = 0;
restart: restart:
{//lock scope {//lock scope
__TBB_ASSERT((m&(m+1))==0, NULL); __TBB_ASSERT((m&(m+1))==0, "data structure is invalid");
return_value = false; return_value = false;
// get bucket // get bucket
bucket_accessor b( this, h & m ); bucket_accessor b( this, h & m );
// find a node // find a node
n = search_bucket( key, b() ); n = search_bucket( key, b() );
if( op_insert ) { if( op_insert ) {
// [opt] insert a key // [opt] insert a key
if( !n ) { if( !n ) {
if( !tmp_n ) { if( !tmp_n ) {
skipping to change at line 1064 skipping to change at line 1065
if( tmp_n ) // if op_insert only if( tmp_n ) // if op_insert only
delete_node( tmp_n ); delete_node( tmp_n );
return return_value; return return_value;
} }
template<typename Key, typename T, typename HashCompare, typename A> template<typename Key, typename T, typename HashCompare, typename A>
template<typename I> template<typename I>
std::pair<I, I> concurrent_hash_map<Key,T,HashCompare,A>::internal_equal_ra nge( const Key& key, I end_ ) const { std::pair<I, I> concurrent_hash_map<Key,T,HashCompare,A>::internal_equal_ra nge( const Key& key, I end_ ) const {
hashcode_t h = my_hash_compare.hash( key ); hashcode_t h = my_hash_compare.hash( key );
hashcode_t m = my_mask; hashcode_t m = my_mask;
__TBB_ASSERT((m&(m+1))==0, NULL); __TBB_ASSERT((m&(m+1))==0, "data structure is invalid");
h &= m; h &= m;
bucket *b = get_bucket( h ); bucket *b = get_bucket( h );
while( b->node_list == internal::rehash_req ) { while( b->node_list == internal::rehash_req ) {
m = ( 1u<<__TBB_Log2( h ) ) - 1; // get parent mask from the topmos t bit m = ( 1u<<__TBB_Log2( h ) ) - 1; // get parent mask from the topmos t bit
b = get_bucket( h &= m ); b = get_bucket( h &= m );
} }
node *n = search_bucket( key, b ); node *n = search_bucket( key, b );
if( !n ) if( !n )
return std::make_pair(end_, end_); return std::make_pair(end_, end_);
iterator lower(*this, h, b, n), upper(lower); iterator lower(*this, h, b, n), upper(lower);
skipping to change at line 1147 skipping to change at line 1148
{ {
typename node::scoped_t item_locker( n->mutex, /*write=*/true ); typename node::scoped_t item_locker( n->mutex, /*write=*/true );
} }
// note: there should be no threads pretending to acquire this mutex ag ain, do not try to upgrade const_accessor! // note: there should be no threads pretending to acquire this mutex ag ain, do not try to upgrade const_accessor!
delete_node( n ); // Only one thread can delete it due to write lock on the bucket delete_node( n ); // Only one thread can delete it due to write lock on the bucket
return true; return true;
} }
template<typename Key, typename T, typename HashCompare, typename A> template<typename Key, typename T, typename HashCompare, typename A>
void concurrent_hash_map<Key,T,HashCompare,A>::swap(concurrent_hash_map<Key ,T,HashCompare,A> &table) { void concurrent_hash_map<Key,T,HashCompare,A>::swap(concurrent_hash_map<Key ,T,HashCompare,A> &table) {
std::swap(this->my_allocator, table.my_allocator); using std::swap;
std::swap(this->my_hash_compare, table.my_hash_compare); swap(this->my_allocator, table.my_allocator);
swap(this->my_hash_compare, table.my_hash_compare);
internal_swap(table); internal_swap(table);
} }
template<typename Key, typename T, typename HashCompare, typename A> template<typename Key, typename T, typename HashCompare, typename A>
void concurrent_hash_map<Key,T,HashCompare,A>::rehash(size_type sz) { void concurrent_hash_map<Key,T,HashCompare,A>::rehash(size_type sz) {
reserve( sz ); // TODO: add reduction of number of buckets as well reserve( sz ); // TODO: add reduction of number of buckets as well
hashcode_t mask = my_mask; hashcode_t mask = my_mask;
hashcode_t b = (mask+1)>>1; // size or first index of the last segment hashcode_t b = (mask+1)>>1; // size or first index of the last segment
__TBB_ASSERT((b&(b-1))==0, NULL); // zero or power of 2 __TBB_ASSERT((b&(b-1))==0, NULL); // zero or power of 2
bucket *bp = get_bucket( b ); // only the last segment should be scanne d for rehashing bucket *bp = get_bucket( b ); // only the last segment should be scanne d for rehashing
skipping to change at line 1221 skipping to change at line 1223
"Performance is not optimal because the hash function produces bad randomness in lower bits in %s.\nSize: %d Empties: %d Overlaps: %d", "Performance is not optimal because the hash function produces bad randomness in lower bits in %s.\nSize: %d Empties: %d Overlaps: %d",
typeid(*this).name(), current_size, empty_buckets, overpopulate d_buckets ); typeid(*this).name(), current_size, empty_buckets, overpopulate d_buckets );
reported = true; reported = true;
} }
#endif #endif
} }
template<typename Key, typename T, typename HashCompare, typename A> template<typename Key, typename T, typename HashCompare, typename A>
void concurrent_hash_map<Key,T,HashCompare,A>::clear() { void concurrent_hash_map<Key,T,HashCompare,A>::clear() {
hashcode_t m = my_mask; hashcode_t m = my_mask;
__TBB_ASSERT((m&(m+1))==0, NULL); __TBB_ASSERT((m&(m+1))==0, "data structure is invalid");
#if TBB_USE_ASSERT || TBB_USE_PERFORMANCE_WARNINGS || __TBB_STATISTICS #if TBB_USE_ASSERT || TBB_USE_PERFORMANCE_WARNINGS || __TBB_STATISTICS
#if TBB_USE_PERFORMANCE_WARNINGS || __TBB_STATISTICS #if TBB_USE_PERFORMANCE_WARNINGS || __TBB_STATISTICS
int current_size = int(my_size), buckets = int(m)+1, empty_buckets = 0, overpopulated_buckets = 0; // usage statistics int current_size = int(my_size), buckets = int(m)+1, empty_buckets = 0, overpopulated_buckets = 0; // usage statistics
static bool reported = false; static bool reported = false;
#endif #endif
bucket *bp = 0; bucket *bp = 0;
// check consistency // check consistency
for( segment_index_t b = 0; b <= m; b++ ) { for( segment_index_t b = 0; b <= m; b++ ) {
if( b & (b-2) ) ++bp; // not the beginning of a segment if( b & (b-2) ) ++bp; // not the beginning of a segment
else bp = get_bucket( b ); else bp = get_bucket( b );
 End of changes. 9 change blocks. 
11 lines changed or deleted 13 lines changed or added


 concurrent_lru_cache.h   concurrent_lru_cache.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 200 skipping to change at line 200
May not clear elements added in pending operations. */ May not clear elements added in pending operations. */
void clear() { void clear() {
data.clear(); data.clear();
mark = 0; mark = 0;
my_size = 0; my_size = 0;
} }
//! Swap this queue with another; not thread-safe //! Swap this queue with another; not thread-safe
/** This operation is unsafe if there are pending concurrent operations on the queue. */ /** This operation is unsafe if there are pending concurrent operations on the queue. */
void swap(concurrent_priority_queue& q) { void swap(concurrent_priority_queue& q) {
using std::swap;
data.swap(q.data); data.swap(q.data);
std::swap(mark, q.mark); swap(mark, q.mark);
std::swap(my_size, q.my_size); swap(my_size, q.my_size);
} }
//! Return allocator object //! Return allocator object
allocator_type get_allocator() const { return data.get_allocator(); } allocator_type get_allocator() const { return data.get_allocator(); }
private: private:
enum operation_type {INVALID_OP, PUSH_OP, POP_OP}; enum operation_type {INVALID_OP, PUSH_OP, POP_OP};
enum operation_status { WAIT=0, SUCCEEDED, FAILED }; enum operation_status { WAIT=0, SUCCEEDED, FAILED };
class cpq_operation : public aggregated_operation<cpq_operation> { class cpq_operation : public aggregated_operation<cpq_operation> {
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added


 concurrent_queue.h   concurrent_queue.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 872 skipping to change at line 872
#if __TBB_INITIALIZER_LISTS_PRESENT #if __TBB_INITIALIZER_LISTS_PRESENT
//! assigns an initializer list //! assigns an initializer list
void assign(std::initializer_list<T> init_list) { void assign(std::initializer_list<T> init_list) {
clear(); internal_assign_iterators( init_list.begin(), init_list.en d()); clear(); internal_assign_iterators( init_list.begin(), init_list.en d());
} }
#endif //# __TBB_INITIALIZER_LISTS_PRESENT #endif //# __TBB_INITIALIZER_LISTS_PRESENT
//! swap two instances //! swap two instances
void swap(concurrent_vector &vector) { void swap(concurrent_vector &vector) {
using std::swap;
if( this != &vector ) { if( this != &vector ) {
concurrent_vector_base_v3::internal_swap(static_cast<concurrent _vector_base_v3&>(vector)); concurrent_vector_base_v3::internal_swap(static_cast<concurrent _vector_base_v3&>(vector));
std::swap(this->my_allocator, vector.my_allocator); swap(this->my_allocator, vector.my_allocator);
} }
} }
//! Clear container while keeping memory allocated. //! Clear container while keeping memory allocated.
/** To free up the memory, use in conjunction with method compact(). No t thread safe **/ /** To free up the memory, use in conjunction with method compact(). No t thread safe **/
void clear() { void clear() {
internal_clear(&destroy_array); internal_clear(&destroy_array);
} }
//! Clear and destroy vector. //! Clear and destroy vector.
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added


 condition_variable   condition_variable 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 780 skipping to change at line 780
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;
// used by apply_body, can invoke body of node. // used by apply_body, can invoke body of node.
bool try_reserve_apply_body(output_type &v) { bool try_reserve_apply_body(output_type &v) {
spin_mutex::scoped_lock lock(my_mutex); spin_mutex::scoped_lock lock(my_mutex);
if ( my_reserved ) { if ( my_reserved ) {
return false; return false;
} }
if ( !my_has_cached_item && (*my_body)(my_cached_item) ) if ( !my_has_cached_item ) {
my_has_cached_item = true; tbb::internal::fgt_begin_body( my_body );
bool r = (*my_body)(my_cached_item);
tbb::internal::fgt_end_body( my_body );
if (r) {
my_has_cached_item = true;
}
}
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;
} }
} }
//! Spawns a task that applies the body //! Spawns a task that applies the body
skipping to change at line 1358 skipping to change at line 1364
case rem_succ: internal_rem_succ(tmp); break; case rem_succ: internal_rem_succ(tmp); break;
case req_item: internal_pop(tmp); break; case req_item: internal_pop(tmp); break;
case res_item: internal_reserve(tmp); break; case res_item: internal_reserve(tmp); break;
case rel_res: internal_release(tmp); try_forwarding = true; b reak; case rel_res: internal_release(tmp); try_forwarding = true; b reak;
case con_res: internal_consume(tmp); try_forwarding = true; b reak; case con_res: internal_consume(tmp); try_forwarding = true; b reak;
case put_item: internal_push(tmp); try_forwarding = true; brea k; case put_item: internal_push(tmp); try_forwarding = true; brea k;
case try_fwd_task: internal_forward_task(tmp); break; case try_fwd_task: internal_forward_task(tmp); break;
} }
} }
if (try_forwarding && !forwarder_busy) { if (try_forwarding && !forwarder_busy) {
forwarder_busy = true;
task* tp = this->my_graph.root_task(); task* tp = this->my_graph.root_task();
if(tp) { if(tp) {
forwarder_busy = true;
task *new_task = new(task::allocate_additional_child_of(*tp )) internal:: task *new_task = new(task::allocate_additional_child_of(*tp )) internal::
forward_task_bypass forward_task_bypass
< buffer_node<input_type, A> >(*this); < buffer_node<input_type, A> >(*this);
// tmp should point to the last item handled by the aggrega tor. This is the operation // tmp should point to the last item handled by the aggrega tor. This is the operation
// the handling thread enqueued. So modifying that record will be okay. // the handling thread enqueued. So modifying that record will be okay.
tbb::task *z = tmp->ltask; tbb::task *z = tmp->ltask;
tmp->ltask = combine_tasks(z, new_task); // in case the op generated a task tmp->ltask = combine_tasks(z, new_task); // in case the op generated a task
} }
} }
} }
skipping to change at line 1808 skipping to change at line 1814
case buffer_node<T, A>::try_fwd_task: internal_forward_task(tmp ); break; case buffer_node<T, A>::try_fwd_task: internal_forward_task(tmp ); break;
case buffer_node<T, A>::rel_res: internal_release(tmp); try_for warding = true; break; case buffer_node<T, A>::rel_res: internal_release(tmp); try_for warding = true; break;
case buffer_node<T, A>::con_res: internal_consume(tmp); try_for warding = true; break; case buffer_node<T, A>::con_res: internal_consume(tmp); try_for warding = true; break;
case buffer_node<T, A>::req_item: internal_pop(tmp); break; case buffer_node<T, A>::req_item: internal_pop(tmp); break;
case buffer_node<T, A>::res_item: internal_reserve(tmp); break; case buffer_node<T, A>::res_item: internal_reserve(tmp); break;
} }
} }
// process pops! for now, no special pop processing // process pops! for now, no special pop processing
if (mark<this->my_tail) heapify(); if (mark<this->my_tail) heapify();
if (try_forwarding && !this->forwarder_busy) { if (try_forwarding && !this->forwarder_busy) {
this->forwarder_busy = true;
task* tp = this->my_graph.root_task(); task* tp = this->my_graph.root_task();
if(tp) { if(tp) {
this->forwarder_busy = true;
task *new_task = new(task::allocate_additional_child_of(*tp )) internal:: task *new_task = new(task::allocate_additional_child_of(*tp )) internal::
forward_task_bypass forward_task_bypass
< buffer_node<input_type, A> >(*this); < buffer_node<input_type, A> >(*this);
// tmp should point to the last item handled by the aggrega tor. This is the operation // tmp should point to the last item handled by the aggrega tor. This is the operation
// the handling thread enqueued. So modifying that record will be okay. // the handling thread enqueued. So modifying that record will be okay.
tbb::task *tmp1 = tmp->ltask; tbb::task *tmp1 = tmp->ltask;
tmp->ltask = combine_tasks(tmp1, new_task); tmp->ltask = combine_tasks(tmp1, new_task);
} }
} }
} }
 End of changes. 6 change blocks. 
5 lines changed or deleted 11 lines changed or added


 gcc_armv7.h   gcc_armv7.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 64 skipping to change at line 64
#elif __LITTLE_ENDIAN__ || (defined(__BYTE_ORDER__) && __BYTE_ORDER__==__OR DER_LITTLE_ENDIAN__) #elif __LITTLE_ENDIAN__ || (defined(__BYTE_ORDER__) && __BYTE_ORDER__==__OR DER_LITTLE_ENDIAN__)
#define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE #define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE
#elif defined(__BYTE_ORDER__) #elif defined(__BYTE_ORDER__)
#define __TBB_ENDIANNESS __TBB_ENDIAN_UNSUPPORTED #define __TBB_ENDIANNESS __TBB_ENDIAN_UNSUPPORTED
#else #else
#define __TBB_ENDIANNESS __TBB_ENDIAN_DETECT #define __TBB_ENDIANNESS __TBB_ENDIAN_DETECT
#endif #endif
#define __TBB_compiler_fence() __asm__ __volatile__("": : :"memory") #define __TBB_compiler_fence() __asm__ __volatile__("": : :"memory")
#define __TBB_full_memory_fence() __asm__ __volatile__("dmb ish": : :"memor y") #define __TBB_full_memory_fence() __asm__ __volatile__("dmb ish": : :"memor y")
#define __TBB_control_consistency_helper() __TBB_compiler_fence() #define __TBB_control_consistency_helper() __TBB_full_memory_fence()
#define __TBB_acquire_consistency_helper() __TBB_full_memory_fence() #define __TBB_acquire_consistency_helper() __TBB_full_memory_fence()
#define __TBB_release_consistency_helper() __TBB_full_memory_fence() #define __TBB_release_consistency_helper() __TBB_full_memory_fence()
//-------------------------------------------------- //--------------------------------------------------
// Compare and swap // Compare and swap
//-------------------------------------------------- //--------------------------------------------------
/** /**
* Atomic CAS for 32 bit values, if *ptr==comparand, then *ptr=value, retur ns *ptr * Atomic CAS for 32 bit values, if *ptr==comparand, then *ptr=value, retur ns *ptr
* @param ptr pointer to value in memory to be swapped with value if *ptr== comparand * @param ptr pointer to value in memory to be swapped with value if *ptr== comparand
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 gcc_generic.h   gcc_generic.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 gcc_ia32_common.h   gcc_ia32_common.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 gcc_itsx.h   gcc_itsx.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 ibm_aix51.h   ibm_aix51.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 icc_generic.h   icc_generic.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 Intel TBB classes and functions. <DD>Include files for Intel TBB 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-2013 Intel Corporation. All Rights Reserved. Copyright &copy; 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 95 skipping to change at line 95
__TBB_MACHINE_DEFINE_ATOMICS(1,int8_t,"","=q") __TBB_MACHINE_DEFINE_ATOMICS(1,int8_t,"","=q")
__TBB_MACHINE_DEFINE_ATOMICS(2,int16_t,"","=r") __TBB_MACHINE_DEFINE_ATOMICS(2,int16_t,"","=r")
__TBB_MACHINE_DEFINE_ATOMICS(4,int32_t,"l","=r") __TBB_MACHINE_DEFINE_ATOMICS(4,int32_t,"l","=r")
#if __INTEL_COMPILER #if __INTEL_COMPILER
#pragma warning( push ) #pragma warning( push )
// reference to EBX in a function requiring stack alignment // reference to EBX in a function requiring stack alignment
#pragma warning( disable: 998 ) #pragma warning( disable: 998 )
#endif #endif
static inline int64_t __TBB_machine_cmpswp8 (volatile void *ptr, int64_t va #if __TBB_GCC_CAS8_BUILTIN_INLINING_BROKEN
lue, int64_t comparand ) { #define __TBB_IA32_CAS8_NOINLINE __attribute__ ((noinline))
#else
#define __TBB_IA32_CAS8_NOINLINE
#endif
static inline __TBB_IA32_CAS8_NOINLINE int64_t __TBB_machine_cmpswp8 (volat
ile void *ptr, int64_t value, int64_t comparand ) {
//TODO: remove the extra part of condition once __TBB_GCC_BUILTIN_ATOMICS_P RESENT is lowered to gcc version 4.1.2 //TODO: remove the extra part of condition once __TBB_GCC_BUILTIN_ATOMICS_P RESENT is lowered to gcc version 4.1.2
#if __TBB_GCC_BUILTIN_ATOMICS_PRESENT || __TBB_GCC_VERSION >= 40304 #if (__TBB_GCC_BUILTIN_ATOMICS_PRESENT || (__TBB_GCC_VERSION >= 40102)) && !__TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN
return __sync_val_compare_and_swap( reinterpret_cast<volatile int64_t*> (ptr), comparand, value ); return __sync_val_compare_and_swap( reinterpret_cast<volatile int64_t*> (ptr), comparand, value );
#else /* !__TBB_GCC_BUILTIN_ATOMICS_PRESENT */ #else /* !__TBB_GCC_BUILTIN_ATOMICS_PRESENT */
//TODO: look like ICC 13.0 has some issues with this code, investigate it more deeply //TODO: look like ICC 13.0 has some issues with this code, investigate it more deeply
int64_t result; int64_t result;
union { union {
int64_t i64; int64_t i64;
int32_t i32[2]; int32_t i32[2];
}; };
i64 = value; i64 = value;
#if __PIC__ #if __PIC__
skipping to change at line 149 skipping to change at line 155
: "m"(*(__TBB_VOLATILE int64_t *)ptr) : "m"(*(__TBB_VOLATILE int64_t *)ptr)
, "0"(comparand) , "0"(comparand)
, "b"(i32[0]), "c"(i32[1]) , "b"(i32[0]), "c"(i32[1])
: "memory" : "memory"
); );
#endif /* __PIC__ */ #endif /* __PIC__ */
return result; return result;
#endif /* !__TBB_GCC_BUILTIN_ATOMICS_PRESENT */ #endif /* !__TBB_GCC_BUILTIN_ATOMICS_PRESENT */
} }
#undef __TBB_IA32_CAS8_NOINLINE
#if __INTEL_COMPILER #if __INTEL_COMPILER
#pragma warning( pop ) #pragma warning( pop )
#endif // warning 998 is back #endif // warning 998 is back
static inline void __TBB_machine_or( volatile void *ptr, uint32_t addend ) { static inline void __TBB_machine_or( volatile void *ptr, uint32_t addend ) {
__asm__ __volatile__("lock\norl %1,%0" : "=m"(*(__TBB_VOLATILE uint32_t *)ptr) : "r"(addend), "m"(*(__TBB_VOLATILE uint32_t *)ptr) : "memory"); __asm__ __volatile__("lock\norl %1,%0" : "=m"(*(__TBB_VOLATILE uint32_t *)ptr) : "r"(addend), "m"(*(__TBB_VOLATILE uint32_t *)ptr) : "memory");
} }
static inline void __TBB_machine_and( volatile void *ptr, uint32_t addend ) { static inline void __TBB_machine_and( volatile void *ptr, uint32_t addend ) {
__asm__ __volatile__("lock\nandl %1,%0" : "=m"(*(__TBB_VOLATILE uint32_ t *)ptr) : "r"(addend), "m"(*(__TBB_VOLATILE uint32_t *)ptr) : "memory"); __asm__ __volatile__("lock\nandl %1,%0" : "=m"(*(__TBB_VOLATILE uint32_ t *)ptr) : "r"(addend), "m"(*(__TBB_VOLATILE uint32_t *)ptr) : "memory");
 End of changes. 4 change blocks. 
4 lines changed or deleted 12 lines changed or added


 linux_ia64.h   linux_ia64.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 mic_common.h   mic_common.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 msvc_armv7.h   msvc_armv7.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 msvc_ia32_common.h   msvc_ia32_common.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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


 mutex.h   mutex.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 44 skipping to change at line 44
#include "partitioner.h" #include "partitioner.h"
#include "blocked_range.h" #include "blocked_range.h"
#include "tbb_exception.h" #include "tbb_exception.h"
namespace tbb { namespace tbb {
namespace interface6 { namespace interface6 {
//! @cond INTERNAL //! @cond INTERNAL
namespace internal { namespace internal {
//! allocate right task with new parent
void* allocate_sibling(task* start_for_task, size_t bytes);
//! Task type used in parallel_for //! Task type used in parallel_for
/** @ingroup algorithms */ /** @ingroup algorithms */
template<typename Range, typename Body, typename Partitioner> template<typename Range, typename Body, typename Partitioner>
class start_for: public task { class start_for: public task {
Range my_range; Range my_range;
const Body my_body; const Body my_body;
typename Partitioner::task_partition_type my_partition; typename Partitioner::task_partition_type my_partition;
/*override*/ task* execute(); /*override*/ task* execute();
//! Update affinity info, if any.
/*override*/ void note_affinity( affinity_id id ) {
my_partition.note_affinity( id );
}
public: public:
//! Constructor for root task. //! Constructor for root task.
start_for( const Range& range, const Body& body, Partitioner& parti tioner ) : start_for( const Range& range, const Body& body, Partitioner& parti tioner ) :
my_range(range), my_range(range),
my_body(body), my_body(body),
my_partition(partitioner) my_partition(partitioner)
{ {
} }
//! Splitting constructor used to generate children. //! Splitting constructor used to generate children.
/** parent_ becomes left child. Newly constructed object is right child. */ /** parent_ becomes left child. Newly constructed object is right child. */
start_for( start_for& parent_, split ) : start_for( start_for& parent_, split ) :
my_range(parent_.my_range,split()), my_range(parent_.my_range, split()),
my_body(parent_.my_body), my_body(parent_.my_body),
my_partition(parent_.my_partition, split()) my_partition(parent_.my_partition, split())
{ {
my_partition.set_affinity(*this); my_partition.set_affinity(*this);
} }
//! Construct right child from the given range as response to the d emand. //! Construct right child from the given range as response to the d emand.
/** parent_ remains left child. Newly constructed object is right child. */ /** parent_ remains left child. Newly constructed object is right child. */
start_for( start_for& parent_, const Range& r, depth_t d ) : start_for( start_for& parent_, const Range& r, depth_t d ) :
my_range(r), my_range(r),
my_body(parent_.my_body), my_body(parent_.my_body),
my_partition(parent_.my_partition,split()) my_partition(parent_.my_partition,split())
{ {
my_partition.set_affinity(*this); my_partition.set_affinity(*this);
my_partition.align_depth( d ); my_partition.align_depth( d );
} }
//! Update affinity info, if any.
/*override*/ void note_affinity( affinity_id id ) {
my_partition.note_affinity( id );
}
static void run( const Range& range, const Body& body, Partitioner & partitioner ) { static void run( const Range& range, const Body& body, Partitioner & partitioner ) {
if( !range.empty() ) { if( !range.empty() ) {
#if !__TBB_TASK_GROUP_CONTEXT || TBB_JOIN_OUTER_TASK_GROUP #if !__TBB_TASK_GROUP_CONTEXT || TBB_JOIN_OUTER_TASK_GROUP
start_for& a = *new(task::allocate_root()) start_for(range, body,partitioner); start_for& a = *new(task::allocate_root()) start_for(range, body,partitioner);
#else #else
// Bound context prevents exceptions from body to affect ne sting or sibling algorithms, // Bound context prevents exceptions from body to affect ne sting or sibling algorithms,
// and allows users to handle exceptions safely by wrapping parallel_for in the try-block. // and allows users to handle exceptions safely by wrapping parallel_for in the try-block.
task_group_context context; task_group_context context;
start_for& a = *new(task::allocate_root(context)) start_for (range,body,partitioner); start_for& a = *new(task::allocate_root(context)) start_for (range,body,partitioner);
#endif /* __TBB_TASK_GROUP_CONTEXT && !TBB_JOIN_OUTER_TASK_GROUP */ #endif /* __TBB_TASK_GROUP_CONTEXT && !TBB_JOIN_OUTER_TASK_GROUP */
skipping to change at line 105 skipping to change at line 109
} }
} }
#if __TBB_TASK_GROUP_CONTEXT #if __TBB_TASK_GROUP_CONTEXT
static void run( const Range& range, const Body& body, Partitioner & partitioner, task_group_context& context ) { static void run( const Range& range, const Body& body, Partitioner & partitioner, task_group_context& context ) {
if( !range.empty() ) { if( !range.empty() ) {
start_for& a = *new(task::allocate_root(context)) start_for (range,body,partitioner); start_for& a = *new(task::allocate_root(context)) start_for (range,body,partitioner);
task::spawn_root_and_wait(a); task::spawn_root_and_wait(a);
} }
} }
#endif /* __TBB_TASK_GROUP_CONTEXT */ #endif /* __TBB_TASK_GROUP_CONTEXT */
//! create a continuation task, serve as callback for partitioner //! Run body for range, serves as callback for partitioner
flag_task *create_continuation() {
return new( allocate_continuation() ) flag_task();
}
//! Run body for range
void run_body( Range &r ) { my_body( r ); } void run_body( Range &r ) { my_body( r ); }
//! spawn right task, serves as callback for partitioner
void offer_work(split) {
spawn( *new( allocate_sibling(static_cast<task*>(this), sizeof(
start_for)) ) start_for(*this, split()) );
}
//! spawn right task, serves as callback for partitioner
void offer_work(const Range& r, depth_t d = 0) {
spawn( *new( allocate_sibling(static_cast<task*>(this), sizeof(
start_for)) ) start_for(*this, r, d) );
}
}; };
//! allocate right task with new parent
// TODO: 'inline' here is to avoid multiple definition error but for sa
ke of code size this should not be inlined
inline void* allocate_sibling(task* start_for_task, size_t bytes) {
task* parent_ptr = new( start_for_task->allocate_continuation() ) f
lag_task();
start_for_task->set_parent(parent_ptr);
parent_ptr->set_ref_count(2);
return &parent_ptr->allocate_child().allocate(bytes);
}
//! execute task for parallel_for
template<typename Range, typename Body, typename Partitioner> template<typename Range, typename Body, typename Partitioner>
task* start_for<Range,Body,Partitioner>::execute() { task* start_for<Range,Body,Partitioner>::execute() {
my_partition.check_being_stolen( *this ); my_partition.check_being_stolen( *this );
my_partition.execute(*this, my_range); my_partition.execute(*this, my_range);
return NULL; return NULL;
} }
} // namespace internal } // namespace internal
//! @endcond //! @endcond
} // namespace interfaceX } // namespace interfaceX
skipping to change at line 134 skipping to change at line 153
namespace internal { namespace internal {
using interface6::internal::start_for; using interface6::internal::start_for;
//! Calls the function with values from range [begin, end) with a step provided //! Calls the function with values from range [begin, end) with a step provided
template<typename Function, typename Index> template<typename Function, typename Index>
class parallel_for_body : internal::no_assign { class parallel_for_body : internal::no_assign {
const Function &my_func; const Function &my_func;
const Index my_begin; const Index my_begin;
const Index my_step; const Index my_step;
public: public:
parallel_for_body( const Function& _func, Index& _begin, Index& _st ep) parallel_for_body( const Function& _func, Index& _begin, Index& _st ep )
: my_func(_func), my_begin(_begin), my_step(_step) {} : my_func(_func), my_begin(_begin), my_step(_step) {}
void operator()( tbb::blocked_range<Index>& r ) const { void operator()( const tbb::blocked_range<Index>& r ) const {
// A set of local variables to help the compiler with vectoriza
tion of the following loop.
Index b = r.begin();
Index e = r.end();
Index ms = my_step;
Index k = my_begin + b*ms;
#if __INTEL_COMPILER #if __INTEL_COMPILER
#pragma ivdep #pragma ivdep
#if __TBB_ASSERT_ON_VECTORIZATION_FAILURE
#pragma vector always assert
#endif #endif
for( Index i = r.begin(), k = my_begin + i * my_step; i < r.en #endif
d(); i++, k = k + my_step) for ( Index i = b; i < e; ++i, k += ms ) {
my_func( k ); my_func( k );
}
} }
}; };
} // namespace internal } // namespace internal
//! @endcond //! @endcond
// Requirements on Range concept are documented in blocked_range.h // Requirements on Range concept are documented in blocked_range.h
/** \page parallel_for_body_req Requirements on parallel_for body /** \page parallel_for_body_req Requirements on parallel_for body
Class \c Body implementing the concept of parallel_for body must define : Class \c Body implementing the concept of parallel_for body must define :
- \code Body::Body( const Body& ); \endcode Copy constr uctor - \code Body::Body( const Body& ); \endcode Copy constr uctor
 End of changes. 13 change blocks. 
15 lines changed or deleted 48 lines changed or added


 parallel_for_each.h   parallel_for_each.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 88 skipping to change at line 88
// Body::join() won't be called if canceled. Defer destruct ion to destructor // Body::join() won't be called if canceled. Defer destruct ion to destructor
} }
if( my_context==left_child ) if( my_context==left_child )
itt_store_word_with_release( static_cast<finish_reduce*>(pa rent())->my_body, my_body ); itt_store_word_with_release( static_cast<finish_reduce*>(pa rent())->my_body, my_body );
return NULL; return NULL;
} }
template<typename Range,typename Body_, typename Partitioner> template<typename Range,typename Body_, typename Partitioner>
friend class start_reduce; friend class start_reduce;
}; };
//! allocate right task with new parent
void allocate_sibling(task* start_reduce_task, task *tasks[], size_t st
art_bytes, size_t finish_bytes);
//! Task type used to split the work of parallel_reduce. //! Task type used to split the work of parallel_reduce.
/** @ingroup algorithms */ /** @ingroup algorithms */
template<typename Range, typename Body, typename Partitioner> template<typename Range, typename Body, typename Partitioner>
class start_reduce: public task { class start_reduce: public task {
typedef finish_reduce<Body> finish_type; typedef finish_reduce<Body> finish_type;
Body* my_body; Body* my_body;
Range my_range; Range my_range;
typename Partitioner::task_partition_type my_partition; typename Partitioner::task_partition_type my_partition;
reduction_context my_context; // TODO: factor out into start_reduce _base reduction_context my_context;
/*override*/ task* execute(); /*override*/ task* execute();
//! Update affinity info, if any
/*override*/ void note_affinity( affinity_id id ) {
my_partition.note_affinity( id );
}
template<typename Body_> template<typename Body_>
friend class finish_reduce; friend class finish_reduce;
public: public:
//! Constructor used for root task //! Constructor used for root task
start_reduce( const Range& range, Body* body, Partitioner& partitio ner ) : start_reduce( const Range& range, Body* body, Partitioner& partitio ner ) :
my_body(body), my_body(body),
my_range(range), my_range(range),
my_partition(partitioner), my_partition(partitioner),
my_context(root_task) my_context(root_task)
{ {
} }
//! Splitting constructor used to generate children. //! Splitting constructor used to generate children.
/** parent_ becomes left child. Newly constructed object is right child. */ /** parent_ becomes left child. Newly constructed object is right child. */
start_reduce( start_reduce& parent_, split ) : start_reduce( start_reduce& parent_, split ) :
my_body(parent_.my_body), my_body(parent_.my_body),
my_range(parent_.my_range,split()), my_range(parent_.my_range, split()),
my_partition(parent_.my_partition,split()), my_partition(parent_.my_partition, split()),
my_context(right_child) my_context(right_child)
{ {
my_partition.set_affinity(*this); my_partition.set_affinity(*this);
parent_.my_context = left_child; parent_.my_context = left_child;
} }
//! Construct right child from the given range as response to the d emand. //! Construct right child from the given range as response to the d emand.
/** parent_ remains left child. Newly constructed object is right child. */ /** parent_ remains left child. Newly constructed object is right child. */
start_reduce( start_reduce& parent_, const Range& r, depth_t d ) : start_reduce( start_reduce& parent_, const Range& r, depth_t d ) :
my_body(parent_.my_body), my_body(parent_.my_body),
my_range(r), my_range(r),
my_partition(parent_.my_partition,split()), my_partition(parent_.my_partition, split()),
my_context(right_child) my_context(right_child)
{ {
my_partition.set_affinity(*this); my_partition.set_affinity(*this);
my_partition.align_depth( d ); my_partition.align_depth( d ); // TODO: move into constructor o f partitioner
parent_.my_context = left_child; parent_.my_context = left_child;
} }
//! Update affinity info, if any
/*override*/ void note_affinity( affinity_id id ) {
my_partition.note_affinity( id );
}
static void run( const Range& range, Body& body, Partitioner& parti tioner ) { static void run( const Range& range, Body& body, Partitioner& parti tioner ) {
if( !range.empty() ) { if( !range.empty() ) {
#if !__TBB_TASK_GROUP_CONTEXT || TBB_JOIN_OUTER_TASK_GROUP #if !__TBB_TASK_GROUP_CONTEXT || TBB_JOIN_OUTER_TASK_GROUP
task::spawn_root_and_wait( *new(task::allocate_root()) star t_reduce(range,&body,partitioner) ); task::spawn_root_and_wait( *new(task::allocate_root()) star t_reduce(range,&body,partitioner) );
#else #else
// Bound context prevents exceptions from body to affect ne sting or sibling algorithms, // Bound context prevents exceptions from body to affect ne sting or sibling algorithms,
// and allows users to handle exceptions safely by wrapping parallel_for in the try-block. // and allows users to handle exceptions safely by wrapping parallel_for in the try-block.
task_group_context context; task_group_context context;
task::spawn_root_and_wait( *new(task::allocate_root(context )) start_reduce(range,&body,partitioner) ); task::spawn_root_and_wait( *new(task::allocate_root(context )) start_reduce(range,&body,partitioner) );
#endif /* __TBB_TASK_GROUP_CONTEXT && !TBB_JOIN_OUTER_TASK_GROUP */ #endif /* __TBB_TASK_GROUP_CONTEXT && !TBB_JOIN_OUTER_TASK_GROUP */
} }
} }
#if __TBB_TASK_GROUP_CONTEXT #if __TBB_TASK_GROUP_CONTEXT
static void run( const Range& range, Body& body, Partitioner& parti tioner, task_group_context& context ) { static void run( const Range& range, Body& body, Partitioner& parti tioner, task_group_context& context ) {
if( !range.empty() ) if( !range.empty() )
task::spawn_root_and_wait( *new(task::allocate_root(context )) start_reduce(range,&body,partitioner) ); task::spawn_root_and_wait( *new(task::allocate_root(context )) start_reduce(range,&body,partitioner) );
} }
#endif /* __TBB_TASK_GROUP_CONTEXT */ #endif /* __TBB_TASK_GROUP_CONTEXT */
//! create a continuation task, serve as callback for partitioner
finish_type *create_continuation() {
return new( allocate_continuation() ) finish_type(my_context);
}
//! Run body for range //! Run body for range
void run_body( Range &r ) { (*my_body)( r ); } void run_body( Range &r ) { (*my_body)( r ); }
//! spawn right task, serves as callback for partitioner
// TODO: remove code duplication from 'offer_work' methods
void offer_work(split) {
task *tasks[2];
allocate_sibling(static_cast<task*>(this), tasks, sizeof(start_
reduce), sizeof(finish_type));
new((void*)tasks[0]) finish_type(my_context);
new((void*)tasks[1]) start_reduce(*this, split());
spawn(*tasks[1]);
}
//! spawn right task, serves as callback for partitioner
void offer_work(const Range& r, depth_t d = 0) {
task *tasks[2];
allocate_sibling(static_cast<task*>(this), tasks, sizeof(start_
reduce), sizeof(finish_type));
new((void*)tasks[0]) finish_type(my_context);
new((void*)tasks[1]) start_reduce(*this, r, d);
spawn(*tasks[1]);
}
}; };
//! allocate right task with new parent
// TODO: 'inline' here is to avoid multiple definition error but for sa
ke of code size this should not be inlined
inline void allocate_sibling(task* start_reduce_task, task *tasks[], si
ze_t start_bytes, size_t finish_bytes) {
tasks[0] = &start_reduce_task->allocate_continuation().allocate(fin
ish_bytes);
start_reduce_task->set_parent(tasks[0]);
tasks[0]->set_ref_count(2);
tasks[1] = &tasks[0]->allocate_child().allocate(start_bytes);
}
template<typename Range, typename Body, typename Partitioner> template<typename Range, typename Body, typename Partitioner>
task* start_reduce<Range,Body,Partitioner>::execute() { task* start_reduce<Range,Body,Partitioner>::execute() {
my_partition.check_being_stolen( *this ); my_partition.check_being_stolen( *this );
if( my_context==right_child ) { if( my_context==right_child ) {
finish_type* parent_ptr = static_cast<finish_type*>(parent()); finish_type* parent_ptr = static_cast<finish_type*>(parent());
if( !itt_load_word_with_acquire(parent_ptr->my_body) ) { // TOD O: replace by is_stolen_task() or by parent_ptr->ref_count() == 2??? if( !itt_load_word_with_acquire(parent_ptr->my_body) ) { // TOD O: replace by is_stolen_task() or by parent_ptr->ref_count() == 2???
my_body = new( parent_ptr->zombie_space.begin() ) Body(*my_ body,split()); my_body = new( parent_ptr->zombie_space.begin() ) Body(*my_ body,split());
parent_ptr->has_right_zombie = true; parent_ptr->has_right_zombie = true;
} }
} else __TBB_ASSERT(my_context==root_task,NULL);// because left lea f spawns right leafs without recycling } else __TBB_ASSERT(my_context==root_task,NULL);// because left lea f spawns right leafs without recycling
 End of changes. 11 change blocks. 
14 lines changed or deleted 47 lines changed or added


 parallel_scan.h   parallel_scan.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 78 skipping to change at line 78
RandomAccessIterator begin; RandomAccessIterator begin;
size_t size; size_t size;
quick_sort_range( RandomAccessIterator begin_, size_t size_, const Comp are &comp_ ) : quick_sort_range( RandomAccessIterator begin_, size_t size_, const Comp are &comp_ ) :
comp(comp_), begin(begin_), size(size_) {} comp(comp_), begin(begin_), size(size_) {}
bool empty() const {return size==0;} bool empty() const {return size==0;}
bool is_divisible() const {return size>=grainsize;} bool is_divisible() const {return size>=grainsize;}
quick_sort_range( quick_sort_range& range, split ) : comp(range.comp) { quick_sort_range( quick_sort_range& range, split ) : comp(range.comp) {
using std::swap;
RandomAccessIterator array = range.begin; RandomAccessIterator array = range.begin;
RandomAccessIterator key0 = range.begin; RandomAccessIterator key0 = range.begin;
size_t m = pseudo_median_of_nine(array, range); size_t m = pseudo_median_of_nine(array, range);
if (m) std::swap ( array[0], array[m] ); if (m) swap ( array[0], array[m] );
size_t i=0; size_t i=0;
size_t j=range.size; size_t j=range.size;
// Partition interval [i+1,j-1] with key *key0. // Partition interval [i+1,j-1] with key *key0.
for(;;) { for(;;) {
__TBB_ASSERT( i<j, NULL ); __TBB_ASSERT( i<j, NULL );
// Loop must terminate since array[l]==*key0. // Loop must terminate since array[l]==*key0.
do { do {
--j; --j;
__TBB_ASSERT( i<=j, "bad ordering relation?" ); __TBB_ASSERT( i<=j, "bad ordering relation?" );
} while( comp( *key0, array[j] )); } while( comp( *key0, array[j] ));
do { do {
__TBB_ASSERT( i<=j, NULL ); __TBB_ASSERT( i<=j, NULL );
if( i==j ) goto partition; if( i==j ) goto partition;
++i; ++i;
} while( comp( array[i],*key0 )); } while( comp( array[i],*key0 ));
if( i==j ) goto partition; if( i==j ) goto partition;
std::swap( array[i], array[j] ); swap( array[i], array[j] );
} }
partition: partition:
// Put the partition key were it belongs // Put the partition key were it belongs
std::swap( array[j], *key0 ); swap( array[j], *key0 );
// array[l..j) is less or equal to key. // array[l..j) is less or equal to key.
// array(j..r) is greater or equal to key. // array(j..r) is greater or equal to key.
// array[j] is equal to key // array[j] is equal to key
i=j+1; i=j+1;
begin = array+i; begin = array+i;
size = range.size-i; size = range.size-i;
range.size = j; range.size = j;
} }
}; };
 End of changes. 5 change blocks. 
4 lines changed or deleted 5 lines changed or added


 parallel_while.h   parallel_while.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 63 skipping to change at line 63
class auto_partitioner; class auto_partitioner;
class simple_partitioner; class simple_partitioner;
class affinity_partitioner; class affinity_partitioner;
namespace interface6 { namespace interface6 {
namespace internal { namespace internal {
class affinity_partition_type; class affinity_partition_type;
} }
} }
namespace internal { namespace internal { //< @cond INTERNAL
size_t __TBB_EXPORTED_FUNC get_initial_auto_partitioner_divisor(); size_t __TBB_EXPORTED_FUNC get_initial_auto_partitioner_divisor();
//! Defines entry point for affinity partitioner into tbb run-time library. //! Defines entry point for affinity partitioner into tbb run-time library.
class affinity_partitioner_base_v3: no_copy { class affinity_partitioner_base_v3: no_copy {
friend class tbb::affinity_partitioner; friend class tbb::affinity_partitioner;
friend class tbb::interface6::internal::affinity_partition_type; friend class tbb::interface6::internal::affinity_partition_type;
//! Array that remembers affinities of tree positions to affinity_id. //! Array that remembers affinities of tree positions to affinity_id.
/** NULL if my_size==0. */ /** NULL if my_size==0. */
affinity_id* my_array; affinity_id* my_array;
//! Number of elements in my_array. //! Number of elements in my_array.
skipping to change at line 98 skipping to change at line 98
void note_affinity( task::affinity_id ) {} void note_affinity( task::affinity_id ) {}
task* continue_after_execute_range() {return NULL;} task* continue_after_execute_range() {return NULL;}
bool decide_whether_to_delay() {return false;} bool decide_whether_to_delay() {return false;}
void spawn_or_delay( bool, task& b ) { void spawn_or_delay( bool, task& b ) {
task::spawn(b); task::spawn(b);
} }
}; };
template<typename Range, typename Body, typename Partitioner> class start_s can; template<typename Range, typename Body, typename Partitioner> class start_s can;
} // namespace internal } //< namespace internal @endcond
//! @endcond
namespace serial { namespace serial {
namespace interface6 { namespace interface6 {
template<typename Range, typename Body, typename Partitioner> class start_f or; template<typename Range, typename Body, typename Partitioner> class start_f or;
} }
} }
namespace interface6 { namespace interface6 {
//! @cond INTERNAL //! @cond INTERNAL
namespace internal { namespace internal {
skipping to change at line 134 skipping to change at line 133
flag.fetch_and_store<release>(true); flag.fetch_and_store<release>(true);
#else #else
flag = true; flag = true;
#endif //TBB_USE_THREADING_TOOLS #endif //TBB_USE_THREADING_TOOLS
} }
static bool is_peer_stolen(task &t) { static bool is_peer_stolen(task &t) {
return static_cast<flag_task*>(t.parent())->my_child_stolen; return static_cast<flag_task*>(t.parent())->my_child_stolen;
} }
}; };
//! Task to signal the demand without carrying the work
class signal_task: public task {
public:
task* execute() {
if( is_stolen_task() ) {
flag_task::mark_task_stolen(*this);
}
return NULL;
}
};
//! Depth is a relative depth of recursive division inside a range pool. Re lative depth allows //! Depth is a relative depth of recursive division inside a range pool. Re lative depth allows
//! infinite absolute depth of the recursion for heavily imbalanced workloa ds with range represented //! infinite absolute depth of the recursion for heavily imbalanced workloa ds with range represented
//! by a number that cannot fit into machine word. //! by a number that cannot fit into machine word.
typedef unsigned char depth_t; typedef unsigned char depth_t;
//! Range pool stores ranges of type T in a circular buffer with MaxCapacit y //! Range pool stores ranges of type T in a circular buffer with MaxCapacit y
template <typename T, depth_t MaxCapacity> template <typename T, depth_t MaxCapacity>
class range_vector { class range_vector {
depth_t my_head; depth_t my_head;
depth_t my_tail; depth_t my_tail;
skipping to change at line 219 skipping to change at line 207
}; };
//! Provides default methods for partition objects and common algorithm blo cks. //! Provides default methods for partition objects and common algorithm blo cks.
template <typename Partition> template <typename Partition>
struct partition_type_base { struct partition_type_base {
// decision makers // decision makers
void set_affinity( task & ) {} void set_affinity( task & ) {}
void note_affinity( task::affinity_id ) {} void note_affinity( task::affinity_id ) {}
bool check_being_stolen(task &) { return false; } // part of old should _execute_range() bool check_being_stolen(task &) { return false; } // part of old should _execute_range()
bool check_for_demand(task &) { return false; } bool check_for_demand(task &) { return false; }
bool divisions_left() { return true; } // part of old should_execute_ra bool is_divisible() { return true; } // part of old should_execute_rang
nge() e()
bool should_create_trap() { return false; }
depth_t max_depth() { return 0; } depth_t max_depth() { return 0; }
void align_depth(depth_t) { } void align_depth(depth_t) { }
// common function blocks // common function blocks
Partition& derived() { return *static_cast<Partition*>(this); } Partition& self() { return *static_cast<Partition*>(this); } // CRTP he
template<typename StartType> lper
flag_task* split_work(StartType &start) {
flag_task* parent_ptr = start.create_continuation(); // the type he
re is to express expectation
start.set_parent(parent_ptr);
parent_ptr->set_ref_count(2);
StartType& right_work = *new( parent_ptr->allocate_child() ) StartT
ype(start, split());
start.spawn(right_work);
return parent_ptr;
}
template<typename StartType, typename Range> template<typename StartType, typename Range>
void execute(StartType &start, Range &range) { void execute(StartType &start, Range &range) {
// The algorithm in a few words ([]-denotes calls to decision metho ds of partitioner): // The algorithm in a few words ([]-denotes calls to decision metho ds of partitioner):
// [If this task is stolen, adjust depth and divisions if necessary , set flag]. // [If this task is stolen, adjust depth and divisions if necessary , set flag].
// If range is divisible { // If range is divisible {
// Spread the work while [initial divisions left]; // Spread the work while [initial divisions left];
// Create trap task [if necessary]; // Create trap task [if necessary];
// } // }
// If not divisible or [max depth is reached], execute, else do the range pool part // If not divisible or [max depth is reached], execute, else do the range pool part
task* parent_ptr = start.parent(); if ( range.is_divisible() ) {
if( range.is_divisible() ) { if ( self().is_divisible() )
if( derived().divisions_left() ) do start.offer_work( split() ); // split until is divisible
do parent_ptr = split_work(start); // split until divisions while ( range.is_divisible() && self().is_divisible() );
_left()
while( range.is_divisible() && derived().divisions_left() )
;
if( derived().should_create_trap() ) { // only for range pool
if( parent_ptr->ref_count() > 1 ) { // create new parent if
necessary
parent_ptr = start.create_continuation();
start.set_parent(parent_ptr);
} else __TBB_ASSERT(parent_ptr->ref_count() == 1, NULL);
parent_ptr->set_ref_count(2); // safe because parent has on
ly one reference
signal_task& right_signal = *new( parent_ptr->allocate_chil
d() ) signal_task();
start.spawn(right_signal); // pure signal is to avoid deep
recursion in the end
}
} }
if( !range.is_divisible() || !derived().max_depth() ) if( !range.is_divisible() || !self().max_depth() )
start.run_body( range ); // simple partitioner goes always here start.run_body( range ); // simple partitioner goes always here
else { // do range pool else { // do range pool
internal::range_vector<Range, Partition::range_pool_size> range _pool(range); internal::range_vector<Range, Partition::range_pool_size> range _pool(range);
do { do {
range_pool.split_to_fill(derived().max_depth()); // fill ra range_pool.split_to_fill(self().max_depth()); // fill range
nge pool pool
if( derived().check_for_demand( start ) ) { if( self().check_for_demand( start ) ) {
if( range_pool.size() > 1 ) { if( range_pool.size() > 1 ) {
parent_ptr = start.create_continuation(); start.offer_work( range_pool.front(), range_pool.fr
start.set_parent(parent_ptr); ont_depth() );
parent_ptr->set_ref_count(2);
StartType& right_work = *new( parent_ptr->allocate_
child() ) StartType(start, range_pool.front(), range_pool.front_depth());
start.spawn(right_work);
range_pool.pop_front(); range_pool.pop_front();
continue; continue;
} }
if( range_pool.back().is_divisible() ) // was not enoug h depth to fork a task if( range_pool.back().is_divisible() ) // was not enoug h depth to fork a task
continue; // note: check_for_demand() should guaran tee increasing max_depth() next time continue; // note: check_for_demand() should guaran tee increasing max_depth() next time
} }
start.run_body( range_pool.back() ); start.run_body( range_pool.back() );
range_pool.pop_back(); range_pool.pop_back();
} while( !range_pool.empty() && !start.is_cancelled() ); } while( !range_pool.empty() && !start.is_cancelled() );
} }
skipping to change at line 322 skipping to change at line 286
// - initial value of my_divisor != 0 (protected by separat e assertion) // - initial value of my_divisor != 0 (protected by separat e assertion)
// - is_stolen_task() always returns false for the root tas k. // - is_stolen_task() always returns false for the root tas k.
#endif #endif
flag_task::mark_task_stolen(t); flag_task::mark_task_stolen(t);
my_max_depth++; my_max_depth++;
return true; return true;
} }
} }
return false; return false;
} }
bool divisions_left() { // part of old should_execute_range() bool is_divisible() { // part of old should_execute_range()
if( my_divisor > 1 ) return true; if( my_divisor > 1 ) return true;
if( my_divisor && my_max_depth > 1 ) { // can split the task and on ce more internally. TODO: on-stack flag instead if( my_divisor && my_max_depth > 1 ) { // can split the task and on ce more internally. TODO: on-stack flag instead
// keep same fragmentation while splitting for the local task p ool // keep same fragmentation while splitting for the local task p ool
my_max_depth--; my_max_depth--;
my_divisor = 0; // decrease max_depth once per task my_divisor = 0; // decrease max_depth once per task
return true; return true;
} else return false; } else return false;
} }
bool should_create_trap() {
return my_divisor > 0;
}
bool check_for_demand(task &t) { bool check_for_demand(task &t) {
if( flag_task::is_peer_stolen(t) ) { if( flag_task::is_peer_stolen(t) ) {
my_max_depth++; my_max_depth++;
return true; return true;
} else return false; } else return false;
} }
void align_depth(depth_t base) { void align_depth(depth_t base) {
__TBB_ASSERT(base <= my_max_depth, 0); __TBB_ASSERT(base <= my_max_depth, 0);
my_max_depth -= base; my_max_depth -= base;
} }
skipping to change at line 402 skipping to change at line 363
__TBB_ASSERT(my_max_depth>__TBB_Log2(map_end-map_mid), 0); __TBB_ASSERT(my_max_depth>__TBB_Log2(map_end-map_mid), 0);
return true;// do not do my_max_depth++ here, but be sure m y_max_depth is big enough return true;// do not do my_max_depth++ here, but be sure m y_max_depth is big enough
} }
if( flag_task::is_peer_stolen(t) ) { if( flag_task::is_peer_stolen(t) ) {
my_max_depth++; my_max_depth++;
return true; return true;
} }
} else my_delay = false; } else my_delay = false;
return false; return false;
} }
bool divisions_left() { // part of old should_execute_range() bool is_divisible() {
return my_divisor > 1; return my_divisor > 1;
} }
bool should_create_trap() {
return false;
}
static const unsigned range_pool_size = __TBB_RANGE_POOL_CAPACITY; static const unsigned range_pool_size = __TBB_RANGE_POOL_CAPACITY;
}; };
class auto_partition_type: public auto_partition_type_base<auto_partition_t ype> { class auto_partition_type: public auto_partition_type_base<auto_partition_t ype> {
public: public:
auto_partition_type( const auto_partitioner& ) {} auto_partition_type( const auto_partitioner& ) {}
auto_partition_type( auto_partition_type& src, split) auto_partition_type( auto_partition_type& src, split)
: auto_partition_type_base<auto_partition_type>(src, split()) {} : auto_partition_type_base<auto_partition_type>(src, split()) {}
static const unsigned range_pool_size = __TBB_RANGE_POOL_CAPACITY; static const unsigned range_pool_size = __TBB_RANGE_POOL_CAPACITY;
}; };
class simple_partition_type: public partition_type_base<simple_partition_ty pe> { class simple_partition_type: public partition_type_base<simple_partition_ty pe> {
public: public:
simple_partition_type( const simple_partitioner& ) {} simple_partition_type( const simple_partitioner& ) {}
simple_partition_type( const simple_partition_type&, split ) {} simple_partition_type( const simple_partition_type&, split ) {}
//! simplified algorithm //! simplified algorithm
template<typename StartType, typename Range> template<typename StartType, typename Range>
void execute(StartType &start, Range &range) { void execute(StartType &start, Range &range) {
while( range.is_divisible() ) while( range.is_divisible() )
split_work( start ); start.offer_work( split() );
start.run_body( range ); start.run_body( range );
} }
//static const unsigned range_pool_size = 1; - not necessary because ex ecute() is overridden //static const unsigned range_pool_size = 1; - not necessary because ex ecute() is overridden
}; };
//! Backward-compatible partition for auto and affinity partition objects. //! Backward-compatible partition for auto and affinity partition objects.
class old_auto_partition_type: public tbb::internal::partition_type_base { class old_auto_partition_type: public tbb::internal::partition_type_base {
size_t num_chunks; size_t num_chunks;
static const size_t VICTIM_CHUNKS = 4; static const size_t VICTIM_CHUNKS = 4;
public: public:
 End of changes. 15 change blocks. 
69 lines changed or deleted 20 lines changed or added


 pipeline.h   pipeline.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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_mutex.h   spin_mutex.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 55 skipping to change at line 55
#endif /* __TBB_TASK_GROUP_CONTEXT */ #endif /* __TBB_TASK_GROUP_CONTEXT */
// MSVC does not allow taking the address of a member that was defined // MSVC does not allow taking the address of a member that was defined
// privately in task_base and made public in class task via a using declara tion. // privately in task_base and made public in class task via a using declara tion.
#if _MSC_VER || (__GNUC__==3 && __GNUC_MINOR__<3) #if _MSC_VER || (__GNUC__==3 && __GNUC_MINOR__<3)
#define __TBB_TASK_BASE_ACCESS public #define __TBB_TASK_BASE_ACCESS public
#else #else
#define __TBB_TASK_BASE_ACCESS private #define __TBB_TASK_BASE_ACCESS private
#endif #endif
namespace internal { namespace internal { //< @cond INTERNAL
class allocate_additional_child_of_proxy: no_assign { class allocate_additional_child_of_proxy: no_assign {
//! No longer used, but retained for binary layout compatibility. Always NULL. //! No longer used, but retained for binary layout compatibility. Always NULL.
task* self; task* self;
task& parent; task& parent;
public: public:
explicit allocate_additional_child_of_proxy( task& parent_ ) : self (NULL), parent(parent_) {} explicit allocate_additional_child_of_proxy( task& parent_ ) : self (NULL), parent(parent_) {}
task& __TBB_EXPORTED_METHOD allocate( size_t size ) const; task& __TBB_EXPORTED_METHOD allocate( size_t size ) const;
void __TBB_EXPORTED_METHOD free( task& ) const; void __TBB_EXPORTED_METHOD free( task& ) const;
}; };
} } //< namespace internal @endcond
namespace interface5 { namespace interface5 {
namespace internal { namespace internal {
//! Base class for methods that became static in TBB 3.0. //! Base class for methods that became static in TBB 3.0.
/** TBB's evolution caused the "this" argument for several methods to become obsolete. /** TBB's evolution caused the "this" argument for several methods to become obsolete.
However, for backwards binary compatibility, the new methods ne ed distinct names, However, for backwards binary compatibility, the new methods ne ed distinct names,
otherwise the One Definition Rule would be broken. Hence the n ew methods are otherwise the One Definition Rule would be broken. Hence the n ew methods are
defined in this private base class, and then exposed in class t ask via defined in this private base class, and then exposed in class t ask via
using declarations. */ using declarations. */
class task_base: tbb::internal::no_copy { class task_base: tbb::internal::no_copy {
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 task_arena.h   task_arena.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 43 skipping to change at line 43
#include "tbb_exception.h" #include "tbb_exception.h"
#if __TBB_TASK_GROUP_CONTEXT #if __TBB_TASK_GROUP_CONTEXT
namespace tbb { namespace tbb {
namespace internal { namespace internal {
template<typename F> class task_handle_task; template<typename F> class task_handle_task;
} }
class task_group;
class structured_task_group;
template<typename F> template<typename F>
class task_handle : internal::no_assign { class task_handle : internal::no_assign {
template<typename _F> friend class internal::task_handle_task; template<typename _F> friend class internal::task_handle_task;
friend class task_group;
friend class structured_task_group;
static const intptr_t scheduled = 0x1; static const intptr_t scheduled = 0x1;
F my_func; F my_func;
intptr_t my_state; intptr_t my_state;
void mark_scheduled () { void mark_scheduled () {
// The check here is intentionally lax to avoid the impact of inter locked operation // The check here is intentionally lax to avoid the impact of inter locked operation
if ( my_state & scheduled ) if ( my_state & scheduled )
internal::throw_exception( internal::eid_invalid_multiple_sched uling ); internal::throw_exception( internal::eid_invalid_multiple_sched uling );
skipping to change at line 206 skipping to change at line 211
internal_run< const F, internal::function_task<F> >( f ); internal_run< const F, internal::function_task<F> >( f );
} }
template<typename F> template<typename F>
task_group_status run_and_wait( const F& f ) { task_group_status run_and_wait( const F& f ) {
return internal_run_and_wait<const F>( f ); return internal_run_and_wait<const F>( f );
} }
template<typename F> template<typename F>
task_group_status run_and_wait( task_handle<F>& h ) { task_group_status run_and_wait( task_handle<F>& h ) {
h.mark_scheduled();
return internal_run_and_wait< task_handle<F> >( h ); return internal_run_and_wait< task_handle<F> >( h );
} }
}; // class task_group }; // class task_group
class structured_task_group : public internal::task_group_base { class structured_task_group : public internal::task_group_base {
public: public:
template<typename F> template<typename F>
task_group_status run_and_wait ( task_handle<F>& h ) { task_group_status run_and_wait ( task_handle<F>& h ) {
h.mark_scheduled();
return internal_run_and_wait< task_handle<F> >( h ); return internal_run_and_wait< task_handle<F> >( h );
} }
task_group_status wait() { task_group_status wait() {
task_group_status res = task_group_base::wait(); task_group_status res = task_group_base::wait();
my_root->set_ref_count(1); my_root->set_ref_count(1);
return res; return res;
} }
}; // class structured_task_group }; // class structured_task_group
 End of changes. 5 change blocks. 
1 lines changed or deleted 8 lines changed or added


 task_scheduler_init.h   task_scheduler_init.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 106 skipping to change at line 106
//! The overloaded method with stack size parameter //! The overloaded method with stack size parameter
/** Overloading is necessary to preserve ABI compatibility */ /** Overloading is necessary to preserve ABI compatibility */
void __TBB_EXPORTED_METHOD initialize( int number_of_threads, stack_siz e_type thread_stack_size ); void __TBB_EXPORTED_METHOD initialize( int number_of_threads, stack_siz e_type thread_stack_size );
//! Inverse of method initialize. //! Inverse of method initialize.
void __TBB_EXPORTED_METHOD terminate(); void __TBB_EXPORTED_METHOD terminate();
//! Shorthand for default constructor followed by call to initialize(nu mber_of_threads). //! Shorthand for default constructor followed by call to initialize(nu mber_of_threads).
#if __TBB_SUPPORTS_WORKERS_WAITING_IN_TERMINATE #if __TBB_SUPPORTS_WORKERS_WAITING_IN_TERMINATE
task_scheduler_init( int number_of_threads=automatic, stack_size_type t hread_stack_size=0, bool wait_workers_in_terminate = false ) task_scheduler_init( int number_of_threads=automatic, stack_size_type t hread_stack_size=0, bool wait_workers_in_terminate = false ) : my_scheduler (NULL)
#else #else
task_scheduler_init( int number_of_threads=automatic, stack_size_type t hread_stack_size=0 ) task_scheduler_init( int number_of_threads=automatic, stack_size_type t hread_stack_size=0 ) : my_scheduler(NULL)
#endif #endif
: my_scheduler(NULL) { {
// Two lowest order bits of the stack size argument may be taken to communicate // Two lowest order bits of the stack size argument may be taken to communicate
// default exception propagation mode of the client to be used when the // default exception propagation mode of the client to be used when the
// client manually creates tasks in the master thread and does not use // client manually creates tasks in the master thread and does not use
// explicit task group context object. This is necessary because ne wer // explicit task group context object. This is necessary because ne wer
// TBB binaries with exact propagation enabled by default may be us ed // TBB binaries with exact propagation enabled by default may be us ed
// by older clients that expect tbb::captured_exception wrapper. // by older clients that expect tbb::captured_exception wrapper.
// All zeros mean old client - no preference. // All zeros mean old client - no preference.
__TBB_ASSERT( !(thread_stack_size & propagation_mode_mask), "Reques ted stack size is not aligned" ); __TBB_ASSERT( !(thread_stack_size & propagation_mode_mask), "Reques ted stack size is not aligned" );
#if TBB_USE_EXCEPTIONS #if TBB_USE_EXCEPTIONS
thread_stack_size |= TBB_USE_CAPTURED_EXCEPTION ? propagation_mode_ captured : propagation_mode_exact; thread_stack_size |= TBB_USE_CAPTURED_EXCEPTION ? propagation_mode_ captured : propagation_mode_exact;
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 task_scheduler_observer.h   task_scheduler_observer.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 442 skipping to change at line 442
the bugs in compilers, standard or OS specific libraries. They should b e the bugs in compilers, standard or OS specific libraries. They should b e
removed as soon as the corresponding bugs are fixed or the buggy OS/com piler removed as soon as the corresponding bugs are fixed or the buggy OS/com piler
versions go out of the support list. versions go out of the support list.
**/ **/
#if __ANDROID__ && __TBB_GCC_VERSION <= 40403 && !__GCC_HAVE_SYNC_COMPARE_A ND_SWAP_8 #if __ANDROID__ && __TBB_GCC_VERSION <= 40403 && !__GCC_HAVE_SYNC_COMPARE_A ND_SWAP_8
/** Necessary because on Android 8-byte CAS and F&A are not available f or some processor architectures, /** Necessary because on Android 8-byte CAS and F&A are not available f or some processor architectures,
but no mandatory warning message appears from GCC 4.4.3. Instead, o nly a linkage error occurs when but no mandatory warning message appears from GCC 4.4.3. Instead, o nly a linkage error occurs when
these atomic operations are used (such as in unit test test_atomic. exe). **/ these atomic operations are used (such as in unit test test_atomic. exe). **/
#define __TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN 1 #define __TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN 1
#elif __TBB_x86_32 && __TBB_GCC_VERSION == 40102 && ! __GNUC_RH_RELEASE__
/** GCC 4.1.2 erroneously emit call to external function for 64 bit syn
c_ intrinsics.
However these functions are not defined anywhere. It seems that thi
s problem was fixed later on
and RHEL got an updated version of gcc 4.1.2. **/
#define __TBB_GCC_64BIT_ATOMIC_BUILTINS_BROKEN 1
#endif #endif
#if __GNUC__ && __TBB_x86_64 && __INTEL_COMPILER == 1200 #if __GNUC__ && __TBB_x86_64 && __INTEL_COMPILER == 1200
#define __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN 1 #define __TBB_ICC_12_0_INL_ASM_FSTCW_BROKEN 1
#endif #endif
#if _MSC_VER && __INTEL_COMPILER && (__INTEL_COMPILER<1110 || __INTEL_COMPI LER==1110 && __INTEL_COMPILER_BUILD_DATE < 20091012) #if _MSC_VER && __INTEL_COMPILER && (__INTEL_COMPILER<1110 || __INTEL_COMPI LER==1110 && __INTEL_COMPILER_BUILD_DATE < 20091012)
/** Necessary to avoid ICL error (or warning in non-strict mode): /** Necessary to avoid ICL error (or warning in non-strict mode):
"exception specification for implicitly declared virtual destructor is "exception specification for implicitly declared virtual destructor is
incompatible with that of overridden one". **/ incompatible with that of overridden one". **/
skipping to change at line 542 skipping to change at line 547
__GNUC__==4 && (__GNUC_MINOR__==4 ||__GNUC_MINOR__==5 || (__INTEL_COMPI LER==1300 && (__GNUC_MINOR__==6 ||__GNUC_MINOR__==7))) __GNUC__==4 && (__GNUC_MINOR__==4 ||__GNUC_MINOR__==5 || (__INTEL_COMPI LER==1300 && (__GNUC_MINOR__==6 ||__GNUC_MINOR__==7)))
/* There is an issue for specific GCC toolchain when C++11 is enabled /* There is an issue for specific GCC toolchain when C++11 is enabled
and exceptions are disabled: and exceptions are disabled:
exceprion_ptr.h/nested_exception.h use throw unconditionally. exceprion_ptr.h/nested_exception.h use throw unconditionally.
*/ */
#define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 1 #define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 1
#else #else
#define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 0 #define __TBB_LIBSTDCPP_EXCEPTION_HEADERS_BROKEN 0
#endif #endif
/*In a PIC mode some versions of GCC 4.1.2 generate incorrect inlined code
for 8 byte __sync_val_compare_and_swap intrinisc */
#if __TBB_GCC_VERSION == 40102 && __PIC__ && !defined(__INTEL_COMPILER) &&
!defined(__clang__)
#define __TBB_GCC_CAS8_BUILTIN_INLINING_BROKEN 1
#endif
#if __TBB_x86_32 && (__linux__ || __APPLE__ || _WIN32 || __sun) && ((defin ed(__INTEL_COMPILER) && __INTEL_COMPILER <= 1400) || (__GNUC__==3 && __GNUC _MINOR__==3 ) || defined(__SUNPRO_CC)) #if __TBB_x86_32 && (__linux__ || __APPLE__ || _WIN32 || __sun) && ((defin ed(__INTEL_COMPILER) && __INTEL_COMPILER <= 1400) || (__GNUC__==3 && __GNUC _MINOR__==3 ) || defined(__SUNPRO_CC))
// Some compilers for IA-32 fail to provide 8-byte alignment of objects on the stack, // Some compilers for IA-32 fail to provide 8-byte alignment of objects on the stack,
// even if the object specifies 8-byte alignment. On such platforms, t he IA-32 implementation // even if the object specifies 8-byte alignment. On such platforms, t he IA-32 implementation
// of 64 bit atomics (e.g. atomic<long long>) use different tactics dep ending upon // of 64 bit atomics (e.g. atomic<long long>) use different tactics dep ending upon
// whether the object is properly aligned or not. // whether the object is properly aligned or not.
#define __TBB_FORCE_64BIT_ALIGNMENT_BROKEN 1 #define __TBB_FORCE_64BIT_ALIGNMENT_BROKEN 1
#else #else
#define __TBB_FORCE_64BIT_ALIGNMENT_BROKEN 0 #define __TBB_FORCE_64BIT_ALIGNMENT_BROKEN 0
#endif #endif
 End of changes. 3 change blocks. 
1 lines changed or deleted 15 lines changed or added


 tbb_exception.h   tbb_exception.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 128 skipping to change at line 128
__TBB_acquire_consistency_helper(), __TBB_release_consistency_helper() __TBB_acquire_consistency_helper(), __TBB_release_consistency_helper()
Must be provided if __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE is set . Must be provided if __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE is set .
Enforce acquire and release semantics in generic implementations of fenced Enforce acquire and release semantics in generic implementations of fenced
store and load operations. Depending on the particular architecture /compiler store and load operations. Depending on the particular architecture /compiler
combination they may be a hardware fence, a compiler fence, both or nothing. combination they may be a hardware fence, a compiler fence, both or nothing.
**/ **/
#include "tbb_stddef.h" #include "tbb_stddef.h"
namespace tbb { namespace tbb {
namespace internal { namespace internal { //< @cond INTERNAL
/////////////////////////////////////////////////////////////////////////// ///// /////////////////////////////////////////////////////////////////////////// /////
// Overridable helpers declarations // Overridable helpers declarations
// //
// A machine/*.h file may choose to define these templates, otherwise it mu st // A machine/*.h file may choose to define these templates, otherwise it mu st
// request default implementation by setting appropriate __TBB_USE_GENERIC_ XXX macro(s). // request default implementation by setting appropriate __TBB_USE_GENERIC_ XXX macro(s).
// //
template <typename T, std::size_t S> template <typename T, std::size_t S>
struct machine_load_store; struct machine_load_store;
skipping to change at line 175 skipping to change at line 175
typedef int32_t word; typedef int32_t word;
#endif #endif
inline static word fetch_store ( volatile void* location, word value ); inline static word fetch_store ( volatile void* location, word value );
}; };
template<> struct atomic_selector<8> { template<> struct atomic_selector<8> {
typedef int64_t word; typedef int64_t word;
inline static word fetch_store ( volatile void* location, word value ); inline static word fetch_store ( volatile void* location, word value );
}; };
}} // namespaces internal, tbb }} //< namespaces internal @endcond, tbb
#define __TBB_MACHINE_DEFINE_STORE8_GENERIC_FENCED(M) \ #define __TBB_MACHINE_DEFINE_STORE8_GENERIC_FENCED(M) \
inline void __TBB_machine_generic_store8##M(volatile void *ptr, int64_t value) { \ inline void __TBB_machine_generic_store8##M(volatile void *ptr, int64_t value) { \
for(;;) { \ for(;;) { \
int64_t result = *(int64_t *)ptr; \ int64_t result = *(int64_t *)ptr; \
if( __TBB_machine_cmpswp8##M(ptr,value,result)==result ) break; \ if( __TBB_machine_cmpswp8##M(ptr,value,result)==result ) break; \
} \ } \
} \ } \
#define __TBB_MACHINE_DEFINE_LOAD8_GENERIC_FENCED(M) \ #define __TBB_MACHINE_DEFINE_LOAD8_GENERIC_FENCED(M) \
skipping to change at line 352 skipping to change at line 352
inline void __TBB_Pause(int32_t) { inline void __TBB_Pause(int32_t) {
__TBB_Yield(); __TBB_Yield();
} }
#endif #endif
namespace tbb { namespace tbb {
//! Sequentially consistent full memory fence. //! Sequentially consistent full memory fence.
inline void atomic_fence () { __TBB_full_memory_fence(); } inline void atomic_fence () { __TBB_full_memory_fence(); }
namespace internal { namespace internal { //< @cond INTERNAL
//! Class that implements exponential backoff. //! Class that implements exponential backoff.
/** See implementation of spin_wait_while_eq for an example. */ /** See implementation of spin_wait_while_eq for an example. */
class atomic_backoff : no_copy { class atomic_backoff : no_copy {
//! Time delay, in units of "pause" instructions. //! Time delay, in units of "pause" instructions.
/** Should be equal to approximately the number of "pause" instructions /** Should be equal to approximately the number of "pause" instructions
that take the same time as an context switch. */ that take the same time as an context switch. */
static const int32_t LOOPS_BEFORE_YIELD = 16; static const int32_t LOOPS_BEFORE_YIELD = 16;
int32_t count; int32_t count;
public: public:
skipping to change at line 836 skipping to change at line 836
0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,
0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,
0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
}; };
} // namespace internal } // namespace internal @endcond
} // namespace tbb } // namespace tbb
// Preserving access to legacy APIs // Preserving access to legacy APIs
using tbb::internal::__TBB_load_with_acquire; using tbb::internal::__TBB_load_with_acquire;
using tbb::internal::__TBB_store_with_release; using tbb::internal::__TBB_store_with_release;
// Mapping historically used names to the ones expected by atomic_load_stor e_traits // Mapping historically used names to the ones expected by atomic_load_stor e_traits
#define __TBB_load_acquire __TBB_load_with_acquire #define __TBB_load_acquire __TBB_load_with_acquire
#define __TBB_store_release __TBB_store_with_release #define __TBB_store_release __TBB_store_with_release
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 tbb_profiling.h   tbb_profiling.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 2 #define TBB_VERSION_MINOR 2
// Engineering-focused interface version // Engineering-focused interface version
#define TBB_INTERFACE_VERSION 7002 #define TBB_INTERFACE_VERSION 7003
#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
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 tbb_thread.h   tbb_thread.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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 64 skipping to change at line 64
#endif #endif
#include <iosfwd> #include <iosfwd>
#if !TBB_USE_EXCEPTIONS && _MSC_VER #if !TBB_USE_EXCEPTIONS && _MSC_VER
#pragma warning (pop) #pragma warning (pop)
#endif #endif
namespace tbb { namespace tbb {
//! @cond INTERNAL
namespace internal { namespace internal {
class tbb_thread_v3; class tbb_thread_v3;
}
} // namespace internal
inline void swap( internal::tbb_thread_v3& t1, internal::tbb_thread_v3& t2 ); inline void swap( internal::tbb_thread_v3& t1, internal::tbb_thread_v3& t2 );
namespace internal { namespace internal {
//! Allocate a closure //! Allocate a closure
void* __TBB_EXPORTED_FUNC allocate_closure_v3( size_t size ); void* __TBB_EXPORTED_FUNC allocate_closure_v3( size_t size );
//! Free a closure allocated by allocate_closure_v3 //! Free a closure allocated by allocate_closure_v3
void __TBB_EXPORTED_FUNC free_closure_v3( void* ); void __TBB_EXPORTED_FUNC free_closure_v3( void* );
 End of changes. 4 change blocks. 
5 lines changed or deleted 2 lines changed or added


 tbbmalloc_proxy.h   tbbmalloc_proxy.h 
/* /*
Copyright 2005-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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-2013 Intel Corporation. All Rights Reserved. Copyright 2005-2014 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/