| /oneTBB/doc/main/tbb_userguide/design_patterns/ |
| H A D | Reference_Counting.rst | 58 std::atomic<int> my_count; 62 counted() {my_count=1;} 64 void add_ref() {++my_count;} 66 bool remove_ref() {return --my_count==0;} 69 assert(my_count>0); 78 decrement, and then both read ``my_count`` as zero. Hence two callers 86 --my_count; 87 return my_count==0. // WRONG!
|
| /oneTBB/test/common/ |
| H A D | graph_utils.h | 267 my_count = 0; 271 my_count = 0; 281 ++my_count; 286 size_t n = my_count; 305 my_count = 0; 319 my_count = 0; 330 ++my_count; 354 my_count = 0; 375 my_count = 0; 381 my_count = 0; [all …]
|
| /oneTBB/examples/graph/dining_philosophers/ |
| H A D | dining_philosophers.cpp | 120 philosopher(const char *name) : my_name(name), my_count(num_times) {} in philosopher() 133 int my_count; member in philosopher 147 << p.name() << ", my_count=" << p.my_count; in operator <<() 189 if (my_count != 0) { in check() 190 std::printf("ERROR: philosopher %s still had to run %d more times\n", name(), my_count); in check() 197 if (my_count < 0) in forward() 199 --my_count; in forward() 202 if (my_count > 0) { in forward()
|
| /oneTBB/test/tbb/ |
| H A D | test_async_node.cpp | 176 CHECK_MESSAGE( ( int(r[i]->my_count) == 1), "counting receiver count not 1" ); in test_reset() 198 … CHECK_MESSAGE( ( int(r[i]->my_count) == N+1), "counting receiver has not received N+1 items" ); in test_reset() 217 … CHECK_MESSAGE( ( int(r[i]->my_count) == 2*N+1), "counting receiver has not received 2N+1 items" ); in test_reset() 254 … CHECK_MESSAGE( ( int(r[0]->my_count) == 3*N+1), "counting receiver has not received 3N+1 items" ); in test_reset() 274 … CHECK_MESSAGE( ( int(r[0]->my_count) == 3*N+1), "counting receiver has not received 3N+1 items" ); in test_reset() 488 … INFO("r1.my_count == " << int(r1.my_count) << " and r2.my_count = " << int(r2.my_count) << "\n" ); in test_copy_ctor() 490 CHECK_MESSAGE( ( int(r1.my_count) == N), "counting receiver r1 has not received N items" ); in test_copy_ctor() 491 CHECK_MESSAGE( ( int(r2.my_count) == 0), "counting receiver r2 has not received 0 items" ); in test_copy_ctor() 499 … INFO("r1.my_count == " << int(r1.my_count) << " and r2.my_count = " << int(r2.my_count) << "\n" ); in test_copy_ctor() 501 CHECK_MESSAGE( ( int(r1.my_count) == N), "counting receiver r1 has not received N items" ); in test_copy_ctor() [all …]
|
| H A D | test_write_once_node.cpp | 66 size_t c = r[i]->my_count; in simple_read_write_tests() 92 size_t c = r[i]->my_count; in simple_read_write_tests() 100 size_t c = r[i]->my_count; in simple_read_write_tests() 157 size_t c = r[i]->my_count; in parallel_read_write_tests() 165 size_t c = r[i]->my_count; in parallel_read_write_tests()
|
| H A D | test_continue_node.cpp | 87 size_t c = receivers[r]->my_count; in run_continue_nodes() 159 size_t c = receivers[r]->my_count; in continue_nodes_with_copy() 255 std::atomic<size_t>& my_count; member 258 : my_thread_id(std::this_thread::get_id()), my_count(count) in lightweight_policy_body() 260 my_count = 0; in lightweight_policy_body() 267 ++my_count; in operator ()() 291 CHECK_MESSAGE( (body1.my_count == n), "Body of the first node needs to be executed N times"); in test_lightweight_policy() 292 CHECK_MESSAGE( (body2.my_count == n), "Body of the second node needs to be executed N times"); in test_lightweight_policy()
|
| H A D | test_overwrite_node.cpp | 72 size_t c = r[i]->my_count; in simple_read_write_tests() 80 size_t c = r[i]->my_count; in simple_read_write_tests() 133 size_t c = r[i]->my_count; in parallel_read_write_tests() 141 size_t c = r[i]->my_count; in parallel_read_write_tests()
|
| H A D | test_split_node.cpp | 106 int my_count; member in my_input_body 109 my_input_body(int init_val, int addto) : my_count(init_val), addend(addto) { } in my_input_body() 111 if(my_count >= Count){ in operator ()() 116 tuple_helper<N>::set_element(v, my_count); in operator ()() 117 my_count += addend; in operator ()()
|
| H A D | test_input_node.cpp | 72 unsigned my_count; member in my_input_body 77 my_input_body() : ninvocations(nullptr) { my_count = 0; } in my_input_body() 78 my_input_body(int &_inv) : ninvocations(&_inv) { my_count = 0; } in my_input_body() 81 T v = (T)my_count++; in operator ()()
|
| H A D | test_indexer_node.cpp | 117 int my_count; member in my_input_body 120 …my_input_body(TT multiplier, int init_val, int addto) : my_mult(multiplier), my_count(init_val), a… in my_input_body() 122 int lc = my_count; in operator ()() 123 TT ret = my_mult * (TT)my_count; in operator ()() 124 my_count += addend; in operator ()()
|
| H A D | test_limiter_node.cpp | 64 std::atomic<int> my_count; member 67 parallel_receiver(tbb::flow::graph& g) : my_graph(g) { my_count = 0; } in parallel_receiver() 70 ++my_count; in try_put_task() 142 CHECK_MESSAGE( r.my_count == N*num_threads, "" ); in test_puts_with_decrements()
|
| H A D | test_function_node.cpp | 313 size_t n = receivers[r]->my_count; in concurrency_levels() 315 receivers[r]->my_count = 0; in concurrency_levels() 324 CHECK( int(receivers[r]->my_count) == 0 ); in concurrency_levels() 396 size_t c = receivers[r]->my_count; in unlimited_concurrency()
|
| H A D | test_multifunction_node.cpp | 299 size_t n = receivers[r]->my_count; in concurrency_levels() 301 receivers[r]->my_count = 0; in concurrency_levels() 310 CHECK_MESSAGE( int(receivers[r]->my_count) == 0, "" ); in concurrency_levels() 383 size_t c = receivers[r]->my_count; in unlimited_concurrency()
|
| H A D | test_eh_flow_graph.cpp | 228 std::atomic<int> *my_count; member in absorber_body 230 absorber_body(std::atomic<int> &my_cnt) : my_count(&my_cnt) { } in absorber_body() 233 int out = ++(*my_count); in operator ()() 237 int count_value() { return *my_count; } in count_value() 268 std::atomic<int> *my_count; member in multifunction_node_body 270 multifunction_node_body(std::atomic<int> &my_cnt) : my_count(&my_cnt) { } in multifunction_node_body() 273 int out = ++(*my_count); in operator ()() 279 int count_value() { return *my_count; } in count_value()
|
| H A D | test_join_node.h | 515 int my_count; 518 my_input_body(int init_val, int addto): my_count(init_val), addend(addto) { } 520 int lc = my_count; 521 TT ret = make_thingie<TT, INDEX>()(my_count); 522 my_count += addend;
|
| /oneTBB/include/oneapi/tbb/ |
| H A D | enumerable_thread_specific.h | 138 std::atomic<std::size_t> my_count; 156 ets_base() : my_root{nullptr}, my_count{0} {} 167 __TBB_ASSERT(!my_count.load(std::memory_order_relaxed), nullptr); 172 my_count.store(other.my_count.load(std::memory_order_relaxed), std::memory_order_relaxed); 195 swap_atomics_relaxed(my_count, other.my_count); 210 my_count.store(0, std::memory_order_relaxed); 246 std::size_t c = ++my_count;
|
| H A D | flow_graph.h | 1887 size_t my_count; // number of successful puts variable 1908 my_count = 0; in decrement_counter() 1911 my_count = my_threshold; in decrement_counter() 1952 ++my_count; in forward_task() 1960 my_count = 0; in forward_task() 2086 if ( my_count + my_tries >= my_threshold ) in try_put_task() 2105 ++my_count; in try_put_task() 2108 my_count -= my_future_decrement; in try_put_task() 2112 my_future_decrement -= my_count; in try_put_task() 2113 my_count = 0; in try_put_task() [all …]
|