Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
concurrent_priority_queue.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2005-2019 Intel Corporation
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 
17 
18 
19 */
20 
21 #ifndef __TBB_concurrent_priority_queue_H
22 #define __TBB_concurrent_priority_queue_H
23 
24 #include "atomic.h"
26 #include "tbb_exception.h"
27 #include "tbb_stddef.h"
28 #include "tbb_profiling.h"
30 #include <vector>
31 #include <iterator>
32 #include <functional>
33 #include __TBB_STD_SWAP_HEADER
34 
35 #if __TBB_INITIALIZER_LISTS_PRESENT
36  #include <initializer_list>
37 #endif
38 
39 #if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
40  #include <type_traits>
41 #endif
42 
43 namespace tbb {
44 namespace interface5 {
45 namespace internal {
46 #if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
48  struct use_element_copy_constructor {
50  };
51  template<typename T>
52  struct use_element_copy_constructor <T,false> {
54  };
55 #else
56  template<typename>
59  };
60 #endif
61 } // namespace internal
62 
63 using namespace tbb::internal;
64 
66 template <typename T, typename Compare=std::less<T>, typename A=cache_aligned_allocator<T> >
68  public:
70  typedef T value_type;
71 
73  typedef T& reference;
74 
76  typedef const T& const_reference;
77 
79  typedef size_t size_type;
80 
82  typedef ptrdiff_t difference_type;
83 
85  typedef A allocator_type;
86 
88  explicit concurrent_priority_queue(const allocator_type& a = allocator_type()) : mark(0), my_size(0), data(a)
89  {
90  my_aggregator.initialize_handler(my_functor_t(this));
91  }
92 
94  explicit concurrent_priority_queue(size_type init_capacity, const allocator_type& a = allocator_type()) :
95  mark(0), my_size(0), data(a)
96  {
97  data.reserve(init_capacity);
98  my_aggregator.initialize_handler(my_functor_t(this));
99  }
100 
102  template<typename InputIterator>
103  concurrent_priority_queue(InputIterator begin, InputIterator end, const allocator_type& a = allocator_type()) :
104  mark(0), data(begin, end, a)
105  {
106  my_aggregator.initialize_handler(my_functor_t(this));
107  heapify();
108  my_size = data.size();
109  }
110 
111 #if __TBB_INITIALIZER_LISTS_PRESENT
112  concurrent_priority_queue(std::initializer_list<T> init_list, const allocator_type &a = allocator_type()) :
114  mark(0),data(init_list.begin(), init_list.end(), a)
115  {
116  my_aggregator.initialize_handler(my_functor_t(this));
117  heapify();
118  my_size = data.size();
119  }
120 #endif //# __TBB_INITIALIZER_LISTS_PRESENT
121 
123 
125  my_size(src.my_size), data(src.data.begin(), src.data.end(), src.data.get_allocator())
126  {
127  my_aggregator.initialize_handler(my_functor_t(this));
128  heapify();
129  }
130 
132 
133  concurrent_priority_queue(const concurrent_priority_queue& src, const allocator_type& a) : mark(src.mark),
134  my_size(src.my_size), data(src.data.begin(), src.data.end(), a)
135  {
136  my_aggregator.initialize_handler(my_functor_t(this));
137  heapify();
138  }
139 
141 
143  if (this != &src) {
144  vector_t(src.data.begin(), src.data.end(), src.data.get_allocator()).swap(data);
145  mark = src.mark;
146  my_size = src.my_size;
147  }
148  return *this;
149  }
150 
151 #if __TBB_CPP11_RVALUE_REF_PRESENT
152 
155  my_size(src.my_size), data(std::move(src.data))
156  {
157  my_aggregator.initialize_handler(my_functor_t(this));
158  }
159 
161 
162  concurrent_priority_queue(concurrent_priority_queue&& src, const allocator_type& a) : mark(src.mark),
163  my_size(src.my_size),
165  data(std::move(src.data), a)
166 #else
167  // Some early version of C++11 STL vector does not have a constructor of vector(vector&& , allocator).
168  // It seems that the reason is absence of support of allocator_traits (stateful allocators).
169  data(a)
170 #endif //__TBB_ALLOCATOR_TRAITS_PRESENT
171  {
172  my_aggregator.initialize_handler(my_functor_t(this));
173 #if !__TBB_ALLOCATOR_TRAITS_PRESENT
174  if (a != src.data.get_allocator()){
175  data.reserve(src.data.size());
176  data.assign(std::make_move_iterator(src.data.begin()), std::make_move_iterator(src.data.end()));
177  }else{
178  data = std::move(src.data);
179  }
180 #endif
181  }
182 
184 
186  if (this != &src) {
187  mark = src.mark;
188  my_size = src.my_size;
189 #if !__TBB_ALLOCATOR_TRAITS_PRESENT
190  if (data.get_allocator() != src.data.get_allocator()){
191  vector_t(std::make_move_iterator(src.data.begin()), std::make_move_iterator(src.data.end()), data.get_allocator()).swap(data);
192  }else
193 #endif
194  {
195  data = std::move(src.data);
196  }
197  }
198  return *this;
199  }
200 #endif //__TBB_CPP11_RVALUE_REF_PRESENT
201 
203  template<typename InputIterator>
204  void assign(InputIterator begin, InputIterator end) {
205  vector_t(begin, end, data.get_allocator()).swap(data);
206  mark = 0;
207  my_size = data.size();
208  heapify();
209  }
210 
211 #if __TBB_INITIALIZER_LISTS_PRESENT
212  void assign(std::initializer_list<T> il) { this->assign(il.begin(), il.end()); }
214 
216  concurrent_priority_queue& operator=(std::initializer_list<T> il) {
217  this->assign(il.begin(), il.end());
218  return *this;
219  }
220 #endif //# __TBB_INITIALIZER_LISTS_PRESENT
221 
223 
225  bool empty() const { return size()==0; }
226 
228 
230  size_type size() const { return __TBB_load_with_acquire(my_size); }
231 
233 
234  void push(const_reference elem) {
235 #if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
236  __TBB_STATIC_ASSERT( std::is_copy_constructible<value_type>::value, "The type is not copy constructible. Copying push operation is impossible." );
237 #endif
238  cpq_operation op_data(elem, PUSH_OP);
239  my_aggregator.execute(&op_data);
240  if (op_data.status == FAILED) // exception thrown
242  }
243 
244 #if __TBB_CPP11_RVALUE_REF_PRESENT
245 
247  void push(value_type &&elem) {
248  cpq_operation op_data(elem, PUSH_RVALUE_OP);
249  my_aggregator.execute(&op_data);
250  if (op_data.status == FAILED) // exception thrown
252  }
253 
254 #if __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT
255 
257  template<typename... Args>
258  void emplace(Args&&... args) {
259  push(value_type(std::forward<Args>(args)...));
260  }
261 #endif /* __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT */
262 #endif /* __TBB_CPP11_RVALUE_REF_PRESENT */
263 
265 
268  bool try_pop(reference elem) {
269  cpq_operation op_data(POP_OP);
270  op_data.elem = &elem;
271  my_aggregator.execute(&op_data);
272  return op_data.status==SUCCEEDED;
273  }
274 
276 
279  void clear() {
280  data.clear();
281  mark = 0;
282  my_size = 0;
283  }
284 
286 
288  using std::swap;
289  data.swap(q.data);
290  swap(mark, q.mark);
291  swap(my_size, q.my_size);
292  }
293 
295  allocator_type get_allocator() const { return data.get_allocator(); }
296 
297  private:
298  enum operation_type {INVALID_OP, PUSH_OP, POP_OP, PUSH_RVALUE_OP};
300 
301  class cpq_operation : public aggregated_operation<cpq_operation> {
302  public:
304  union {
305  value_type *elem;
306  size_type sz;
307  };
308  cpq_operation(const_reference e, operation_type t) :
309  type(t), elem(const_cast<value_type*>(&e)) {}
311  };
312 
313  class my_functor_t {
315  public:
318  void operator()(cpq_operation* op_list) {
319  cpq->handle_operations(op_list);
320  }
321  };
322 
324  aggregator_t my_aggregator;
326  char padding1[NFS_MaxLineSize - sizeof(aggregator_t)];
328  size_type mark;
330  Compare compare;
332  char padding2[NFS_MaxLineSize - (2*sizeof(size_type)) - sizeof(Compare)];
334 
351  typedef std::vector<value_type, allocator_type> vector_t;
352  vector_t data;
353 
354  void handle_operations(cpq_operation *op_list) {
355  cpq_operation *tmp, *pop_list=NULL;
356 
357  __TBB_ASSERT(mark == data.size(), NULL);
358 
359  // First pass processes all constant (amortized; reallocation may happen) time pushes and pops.
360  while (op_list) {
361  // ITT note: &(op_list->status) tag is used to cover accesses to op_list
362  // node. This thread is going to handle the operation, and so will acquire it
363  // and perform the associated operation w/o triggering a race condition; the
364  // thread that created the operation is waiting on the status field, so when
365  // this thread is done with the operation, it will perform a
366  // store_with_release to give control back to the waiting thread in
367  // aggregator::insert_operation.
368  call_itt_notify(acquired, &(op_list->status));
369  __TBB_ASSERT(op_list->type != INVALID_OP, NULL);
370  tmp = op_list;
371  op_list = itt_hide_load_word(op_list->next);
372  if (tmp->type == POP_OP) {
373  if (mark < data.size() &&
374  compare(data[0], data[data.size()-1])) {
375  // there are newly pushed elems and the last one
376  // is higher than top
377  *(tmp->elem) = tbb::internal::move(data[data.size()-1]);
378  __TBB_store_with_release(my_size, my_size-1);
379  itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
380  data.pop_back();
381  __TBB_ASSERT(mark<=data.size(), NULL);
382  }
383  else { // no convenient item to pop; postpone
384  itt_hide_store_word(tmp->next, pop_list);
385  pop_list = tmp;
386  }
387  } else { // PUSH_OP or PUSH_RVALUE_OP
388  __TBB_ASSERT(tmp->type == PUSH_OP || tmp->type == PUSH_RVALUE_OP, "Unknown operation" );
389  __TBB_TRY{
390  if (tmp->type == PUSH_OP) {
391  push_back_helper(*(tmp->elem), typename internal::use_element_copy_constructor<value_type>::type());
392  } else {
393  data.push_back(tbb::internal::move(*(tmp->elem)));
394  }
395  __TBB_store_with_release(my_size, my_size + 1);
396  itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
397  } __TBB_CATCH(...) {
398  itt_store_word_with_release(tmp->status, uintptr_t(FAILED));
399  }
400  }
401  }
402 
403  // second pass processes pop operations
404  while (pop_list) {
405  tmp = pop_list;
406  pop_list = itt_hide_load_word(pop_list->next);
407  __TBB_ASSERT(tmp->type == POP_OP, NULL);
408  if (data.empty()) {
409  itt_store_word_with_release(tmp->status, uintptr_t(FAILED));
410  }
411  else {
412  __TBB_ASSERT(mark<=data.size(), NULL);
413  if (mark < data.size() &&
414  compare(data[0], data[data.size()-1])) {
415  // there are newly pushed elems and the last one is
416  // higher than top
417  *(tmp->elem) = tbb::internal::move(data[data.size()-1]);
418  __TBB_store_with_release(my_size, my_size-1);
419  itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
420  data.pop_back();
421  }
422  else { // extract top and push last element down heap
423  *(tmp->elem) = tbb::internal::move(data[0]);
424  __TBB_store_with_release(my_size, my_size-1);
425  itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
426  reheap();
427  }
428  }
429  }
430 
431  // heapify any leftover pushed elements before doing the next
432  // batch of operations
433  if (mark<data.size()) heapify();
434  __TBB_ASSERT(mark == data.size(), NULL);
435  }
436 
438  void heapify() {
439  if (!mark && data.size()>0) mark = 1;
440  for (; mark<data.size(); ++mark) {
441  // for each unheapified element under size
442  size_type cur_pos = mark;
443  value_type to_place = tbb::internal::move(data[mark]);
444  do { // push to_place up the heap
445  size_type parent = (cur_pos-1)>>1;
446  if (!compare(data[parent], to_place)) break;
447  data[cur_pos] = tbb::internal::move(data[parent]);
448  cur_pos = parent;
449  } while( cur_pos );
450  data[cur_pos] = tbb::internal::move(to_place);
451  }
452  }
453 
455 
456  void reheap() {
457  size_type cur_pos=0, child=1;
458 
459  while (child < mark) {
460  size_type target = child;
461  if (child+1 < mark && compare(data[child], data[child+1]))
462  ++target;
463  // target now has the higher priority child
464  if (compare(data[target], data[data.size()-1])) break;
465  data[cur_pos] = tbb::internal::move(data[target]);
466  cur_pos = target;
467  child = (cur_pos<<1)+1;
468  }
469  if (cur_pos != data.size()-1)
470  data[cur_pos] = tbb::internal::move(data[data.size()-1]);
471  data.pop_back();
472  if (mark > data.size()) mark = data.size();
473  }
474 
476  data.push_back(t);
477  }
478 
480  __TBB_ASSERT( false, "The type is not copy constructible. Copying push operation is impossible." );
481  }
482 };
483 
484 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT
485 // Deduction guide for the constructor from two iterators
486 template<typename InputIterator,
487  typename T = typename std::iterator_traits<InputIterator>::value_type,
488  typename A = cache_aligned_allocator<T>
489 > concurrent_priority_queue(InputIterator, InputIterator, const A& = A())
491 #endif /* __TBB_CPP17_DEDUCTION_GUIDES_PRESENT */
492 } // namespace interface5
493 
495 
496 } // namespace tbb
497 
498 #endif /* __TBB_concurrent_priority_queue_H */
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp end
T itt_hide_load_word(const T &src)
tbb::internal::aggregator< my_functor_t, cpq_operation > aggregator_t
std::vector< value_type, allocator_type > vector_t
Storage for the heap of elements in queue, plus unheapified elements.
concurrent_priority_queue(concurrent_priority_queue &&src)
Move constructor.
#define __TBB_ALLOCATOR_TRAITS_PRESENT
Definition: tbb_config.h:350
void heapify()
Merge unsorted elements into heap.
T __TBB_load_with_acquire(const volatile T &location)
Definition: tbb_machine.h:716
#define __TBB_STATIC_ASSERT(condition, msg)
Definition: tbb_stddef.h:536
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
void itt_store_word_with_release(tbb::atomic< T > &dst, U src)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp begin
concurrent_priority_queue(concurrent_priority_queue &&src, const allocator_type &a)
Move constructor with specific allocator.
concurrent_priority_queue & operator=(std::initializer_list< T > il)
Assign from std::initializer_list, not thread-safe.
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
concurrent_priority_queue & operator=(concurrent_priority_queue &&src)
Move assignment operator.
size_type size() const
Returns the current number of elements contained in the queue.
concurrent_priority_queue & operator=(const concurrent_priority_queue &src)
Assignment operator.
void reheap()
Re-heapify after an extraction.
void swap(atomic< T > &lhs, atomic< T > &rhs)
Definition: atomic.h:539
#define __TBB_TRY
Definition: tbb_stddef.h:287
allocator_type get_allocator() const
Return allocator object.
bool try_pop(reference elem)
Gets a reference to and removes highest priority element.
concurrent_priority_queue(const allocator_type &a=allocator_type())
Constructs a new concurrent_priority_queue with default capacity.
size_t size_type
Integral type for representing size of the queue.
size_type mark
The point at which unsorted elements begin.
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
bool empty() const
Returns true if empty, false otherwise.
#define __TBB_CATCH(e)
Definition: tbb_stddef.h:288
void clear()
Clear the queue; not thread-safe.
void push(const_reference elem)
Pushes elem onto the queue, increasing capacity of queue if necessary.
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void * data
The graph class.
void swap(concurrent_hash_map< Key, T, HashCompare, A > &a, concurrent_hash_map< Key, T, HashCompare, A > &b)
void push(value_type &&elem)
Pushes elem onto the queue, increasing capacity of queue if necessary.
void push_back_helper(const T &t, tbb::internal::true_type)
void assign(InputIterator begin, InputIterator end)
Assign the queue from [begin,end) range, not thread-safe.
void push_back_helper(const T &, tbb::internal::false_type)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
concurrent_priority_queue(size_type init_capacity, const allocator_type &a=allocator_type())
Constructs a new concurrent_priority_queue with init_sz capacity.
ptrdiff_t difference_type
Difference type for iterator.
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id parent
void call_itt_notify(notify_type, void *)
my_functor_t(concurrent_priority_queue< T, Compare, A > *cpq_)
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:309
concurrent_priority_queue(const concurrent_priority_queue &src)
Copy constructor.
const size_t NFS_MaxLineSize
Compile-time constant that is upper bound on cache line/sector size.
Definition: tbb_stddef.h:220
void itt_hide_store_word(T &dst, T src)
concurrent_priority_queue(InputIterator begin, InputIterator end, const allocator_type &a=allocator_type())
[begin,end) constructor
STL namespace.
#define __TBB_atomic
Definition: tbb_stddef.h:241
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t size
Identifiers declared inside namespace internal should never be used directly by client code...
Definition: atomic.h:55
void emplace(Args &&... args)
Constructs a new element using args as the arguments for its construction and pushes it onto the queu...
concurrent_priority_queue(const concurrent_priority_queue &src, const allocator_type &a)
Copy constructor with specific allocator.
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:720
void swap(concurrent_priority_queue &q)
Swap this queue with another; not thread-safe.

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

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

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