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 #ifndef __TBB_concurrent_priority_queue_H
18 #define __TBB_concurrent_priority_queue_H
19 
20 #include "atomic.h"
22 #include "tbb_exception.h"
23 #include "tbb_stddef.h"
24 #include "tbb_profiling.h"
28 #include <vector>
29 #include <iterator>
30 #include <functional>
31 #include __TBB_STD_SWAP_HEADER
32 
33 #if __TBB_INITIALIZER_LISTS_PRESENT
34  #include <initializer_list>
35 #endif
36 
37 #if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
38  #include <type_traits>
39 #endif
40 
41 namespace tbb {
42 namespace interface5 {
43 namespace internal {
44 #if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
46  struct use_element_copy_constructor {
48  };
49  template<typename T>
50  struct use_element_copy_constructor <T,false> {
52  };
53 #else
54  template<typename>
57  };
58 #endif
59 } // namespace internal
60 
61 using namespace tbb::internal;
62 
64 template <typename T, typename Compare=std::less<T>, typename A=cache_aligned_allocator<T> >
66  public:
68  typedef T value_type;
69 
71  typedef T& reference;
72 
74  typedef const T& const_reference;
75 
77  typedef size_t size_type;
78 
80  typedef ptrdiff_t difference_type;
81 
83  typedef A allocator_type;
84 
86  explicit concurrent_priority_queue(const allocator_type& a = allocator_type()) : mark(0), my_size(0), compare(), data(a)
87  {
88  my_aggregator.initialize_handler(my_functor_t(this));
89  }
90 
92  explicit concurrent_priority_queue(const Compare& c, const allocator_type& a = allocator_type()) : mark(0), my_size(0), compare(c), data(a)
93  {
94  my_aggregator.initialize_handler(my_functor_t(this));
95  }
96 
98  explicit concurrent_priority_queue(size_type init_capacity, const allocator_type& a = allocator_type()) :
99  mark(0), my_size(0), compare(), data(a)
100  {
101  data.reserve(init_capacity);
102  my_aggregator.initialize_handler(my_functor_t(this));
103  }
104 
106  explicit concurrent_priority_queue(size_type init_capacity, const Compare& c, const allocator_type& a = allocator_type()) :
107  mark(0), my_size(0), compare(c), data(a)
108  {
109  data.reserve(init_capacity);
110  my_aggregator.initialize_handler(my_functor_t(this));
111  }
112 
114  template<typename InputIterator>
115  concurrent_priority_queue(InputIterator begin, InputIterator end, const allocator_type& a = allocator_type()) :
116  mark(0), compare(), data(begin, end, a)
117  {
118  my_aggregator.initialize_handler(my_functor_t(this));
119  heapify();
120  my_size = data.size();
121  }
122 
124  template<typename InputIterator>
125  concurrent_priority_queue(InputIterator begin, InputIterator end, const Compare& c, const allocator_type& a = allocator_type()) :
126  mark(0), compare(c), data(begin, end, a)
127  {
128  my_aggregator.initialize_handler(my_functor_t(this));
129  heapify();
130  my_size = data.size();
131  }
132 
133 #if __TBB_INITIALIZER_LISTS_PRESENT
134  concurrent_priority_queue(std::initializer_list<T> init_list, const allocator_type &a = allocator_type()) :
136  mark(0), compare(), data(init_list.begin(), init_list.end(), a)
137  {
138  my_aggregator.initialize_handler(my_functor_t(this));
139  heapify();
140  my_size = data.size();
141  }
142 
144  concurrent_priority_queue(std::initializer_list<T> init_list, const Compare& c, const allocator_type &a = allocator_type()) :
145  mark(0), compare(c), data(init_list.begin(), init_list.end(), a)
146  {
147  my_aggregator.initialize_handler(my_functor_t(this));
148  heapify();
149  my_size = data.size();
150  }
151 #endif //# __TBB_INITIALIZER_LISTS_PRESENT
152 
154 
156  my_size(src.my_size), data(src.data.begin(), src.data.end(), src.data.get_allocator())
157  {
158  my_aggregator.initialize_handler(my_functor_t(this));
159  heapify();
160  }
161 
163 
165  my_size(src.my_size), data(src.data.begin(), src.data.end(), a)
166  {
167  my_aggregator.initialize_handler(my_functor_t(this));
168  heapify();
169  }
170 
172 
174  if (this != &src) {
175  vector_t(src.data.begin(), src.data.end(), src.data.get_allocator()).swap(data);
176  mark = src.mark;
177  my_size = src.my_size;
178  }
179  return *this;
180  }
181 
182 #if __TBB_CPP11_RVALUE_REF_PRESENT
183 
186  my_size(src.my_size), data(std::move(src.data))
187  {
188  my_aggregator.initialize_handler(my_functor_t(this));
189  }
190 
192 
194  my_size(src.my_size),
196  data(std::move(src.data), a)
197 #else
198  // Some early version of C++11 STL vector does not have a constructor of vector(vector&& , allocator).
199  // It seems that the reason is absence of support of allocator_traits (stateful allocators).
200  data(a)
201 #endif //__TBB_ALLOCATOR_TRAITS_PRESENT
202  {
203  my_aggregator.initialize_handler(my_functor_t(this));
204 #if !__TBB_ALLOCATOR_TRAITS_PRESENT
205  if (a != src.data.get_allocator()){
206  data.reserve(src.data.size());
207  data.assign(std::make_move_iterator(src.data.begin()), std::make_move_iterator(src.data.end()));
208  }else{
209  data = std::move(src.data);
210  }
211 #endif
212  }
213 
215 
217  if (this != &src) {
218  mark = src.mark;
219  my_size = src.my_size;
220 #if !__TBB_ALLOCATOR_TRAITS_PRESENT
221  if (data.get_allocator() != src.data.get_allocator()){
222  vector_t(std::make_move_iterator(src.data.begin()), std::make_move_iterator(src.data.end()), data.get_allocator()).swap(data);
223  }else
224 #endif
225  {
226  data = std::move(src.data);
227  }
228  }
229  return *this;
230  }
231 #endif //__TBB_CPP11_RVALUE_REF_PRESENT
232 
234  template<typename InputIterator>
235  void assign(InputIterator begin, InputIterator end) {
236  vector_t(begin, end, data.get_allocator()).swap(data);
237  mark = 0;
238  my_size = data.size();
239  heapify();
240  }
241 
242 #if __TBB_INITIALIZER_LISTS_PRESENT
243  void assign(std::initializer_list<T> il) { this->assign(il.begin(), il.end()); }
245 
247  concurrent_priority_queue& operator=(std::initializer_list<T> il) {
248  this->assign(il.begin(), il.end());
249  return *this;
250  }
251 #endif //# __TBB_INITIALIZER_LISTS_PRESENT
252 
254 
256  bool empty() const { return size()==0; }
257 
259 
261  size_type size() const { return __TBB_load_with_acquire(my_size); }
262 
264 
265  void push(const_reference elem) {
266 #if __TBB_CPP11_IS_COPY_CONSTRUCTIBLE_PRESENT
267  __TBB_STATIC_ASSERT( std::is_copy_constructible<value_type>::value, "The type is not copy constructible. Copying push operation is impossible." );
268 #endif
269  cpq_operation op_data(elem, PUSH_OP);
270  my_aggregator.execute(&op_data);
271  if (op_data.status == FAILED) // exception thrown
273  }
274 
275 #if __TBB_CPP11_RVALUE_REF_PRESENT
276 
278  void push(value_type &&elem) {
279  cpq_operation op_data(elem, PUSH_RVALUE_OP);
280  my_aggregator.execute(&op_data);
281  if (op_data.status == FAILED) // exception thrown
283  }
284 
285 #if __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT
286 
288  template<typename... Args>
289  void emplace(Args&&... args) {
290  push(value_type(std::forward<Args>(args)...));
291  }
292 #endif /* __TBB_CPP11_VARIADIC_TEMPLATES_PRESENT */
293 #endif /* __TBB_CPP11_RVALUE_REF_PRESENT */
294 
296 
299  bool try_pop(reference elem) {
300  cpq_operation op_data(POP_OP);
301  op_data.elem = &elem;
302  my_aggregator.execute(&op_data);
303  return op_data.status==SUCCEEDED;
304  }
305 
307 
310  void clear() {
311  data.clear();
312  mark = 0;
313  my_size = 0;
314  }
315 
317 
319  using std::swap;
320  data.swap(q.data);
321  swap(mark, q.mark);
322  swap(my_size, q.my_size);
323  }
324 
326  allocator_type get_allocator() const { return data.get_allocator(); }
327 
328  private:
329  enum operation_type {INVALID_OP, PUSH_OP, POP_OP, PUSH_RVALUE_OP};
331 
332  class cpq_operation : public aggregated_operation<cpq_operation> {
333  public:
335  union {
338  };
340  type(t), elem(const_cast<value_type*>(&e)) {}
342  };
343 
344  class my_functor_t {
346  public:
349  void operator()(cpq_operation* op_list) {
350  cpq->handle_operations(op_list);
351  }
352  };
353 
357  char padding1[NFS_MaxLineSize - sizeof(aggregator_t)];
361  Compare compare;
363  char padding2[NFS_MaxLineSize - (2*sizeof(size_type)) - sizeof(Compare)];
365 
382  typedef std::vector<value_type, allocator_type> vector_t;
384 
385  void handle_operations(cpq_operation *op_list) {
386  cpq_operation *tmp, *pop_list=NULL;
387 
388  __TBB_ASSERT(mark == data.size(), NULL);
389 
390  // First pass processes all constant (amortized; reallocation may happen) time pushes and pops.
391  while (op_list) {
392  // ITT note: &(op_list->status) tag is used to cover accesses to op_list
393  // node. This thread is going to handle the operation, and so will acquire it
394  // and perform the associated operation w/o triggering a race condition; the
395  // thread that created the operation is waiting on the status field, so when
396  // this thread is done with the operation, it will perform a
397  // store_with_release to give control back to the waiting thread in
398  // aggregator::insert_operation.
399  call_itt_notify(acquired, &(op_list->status));
400  __TBB_ASSERT(op_list->type != INVALID_OP, NULL);
401  tmp = op_list;
402  op_list = itt_hide_load_word(op_list->next);
403  if (tmp->type == POP_OP) {
404  if (mark < data.size() &&
405  compare(data[0], data[data.size()-1])) {
406  // there are newly pushed elems and the last one
407  // is higher than top
408  *(tmp->elem) = tbb::internal::move(data[data.size()-1]);
409  __TBB_store_with_release(my_size, my_size-1);
410  itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
411  data.pop_back();
412  __TBB_ASSERT(mark<=data.size(), NULL);
413  }
414  else { // no convenient item to pop; postpone
415  itt_hide_store_word(tmp->next, pop_list);
416  pop_list = tmp;
417  }
418  } else { // PUSH_OP or PUSH_RVALUE_OP
419  __TBB_ASSERT(tmp->type == PUSH_OP || tmp->type == PUSH_RVALUE_OP, "Unknown operation" );
420  __TBB_TRY{
421  if (tmp->type == PUSH_OP) {
422  push_back_helper(*(tmp->elem), typename internal::use_element_copy_constructor<value_type>::type());
423  } else {
424  data.push_back(tbb::internal::move(*(tmp->elem)));
425  }
426  __TBB_store_with_release(my_size, my_size + 1);
427  itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
428  } __TBB_CATCH(...) {
429  itt_store_word_with_release(tmp->status, uintptr_t(FAILED));
430  }
431  }
432  }
433 
434  // second pass processes pop operations
435  while (pop_list) {
436  tmp = pop_list;
437  pop_list = itt_hide_load_word(pop_list->next);
438  __TBB_ASSERT(tmp->type == POP_OP, NULL);
439  if (data.empty()) {
440  itt_store_word_with_release(tmp->status, uintptr_t(FAILED));
441  }
442  else {
443  __TBB_ASSERT(mark<=data.size(), NULL);
444  if (mark < data.size() &&
445  compare(data[0], data[data.size()-1])) {
446  // there are newly pushed elems and the last one is
447  // higher than top
448  *(tmp->elem) = tbb::internal::move(data[data.size()-1]);
449  __TBB_store_with_release(my_size, my_size-1);
450  itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
451  data.pop_back();
452  }
453  else { // extract top and push last element down heap
454  *(tmp->elem) = tbb::internal::move(data[0]);
455  __TBB_store_with_release(my_size, my_size-1);
456  itt_store_word_with_release(tmp->status, uintptr_t(SUCCEEDED));
457  reheap();
458  }
459  }
460  }
461 
462  // heapify any leftover pushed elements before doing the next
463  // batch of operations
464  if (mark<data.size()) heapify();
465  __TBB_ASSERT(mark == data.size(), NULL);
466  }
467 
469  void heapify() {
470  if (!mark && data.size()>0) mark = 1;
471  for (; mark<data.size(); ++mark) {
472  // for each unheapified element under size
473  size_type cur_pos = mark;
474  value_type to_place = tbb::internal::move(data[mark]);
475  do { // push to_place up the heap
476  size_type parent = (cur_pos-1)>>1;
477  if (!compare(data[parent], to_place)) break;
478  data[cur_pos] = tbb::internal::move(data[parent]);
479  cur_pos = parent;
480  } while( cur_pos );
481  data[cur_pos] = tbb::internal::move(to_place);
482  }
483  }
484 
486 
487  void reheap() {
488  size_type cur_pos=0, child=1;
489 
490  while (child < mark) {
491  size_type target = child;
492  if (child+1 < mark && compare(data[child], data[child+1]))
493  ++target;
494  // target now has the higher priority child
495  if (compare(data[target], data[data.size()-1])) break;
496  data[cur_pos] = tbb::internal::move(data[target]);
497  cur_pos = target;
498  child = (cur_pos<<1)+1;
499  }
500  if (cur_pos != data.size()-1)
501  data[cur_pos] = tbb::internal::move(data[data.size()-1]);
502  data.pop_back();
503  if (mark > data.size()) mark = data.size();
504  }
505 
507  data.push_back(t);
508  }
509 
511  __TBB_ASSERT( false, "The type is not copy constructible. Copying push operation is impossible." );
512  }
513 };
514 
515 #if __TBB_CPP17_DEDUCTION_GUIDES_PRESENT
516 namespace internal {
517 
518 template<typename T, typename... Args>
519 using priority_queue_t = concurrent_priority_queue<
520  T,
521  std::conditional_t< (sizeof...(Args)>0) && !is_allocator_v< pack_element_t<0, Args...> >,
522  pack_element_t<0, Args...>, std::less<T> >,
523  std::conditional_t< (sizeof...(Args)>0) && is_allocator_v< pack_element_t<sizeof...(Args)-1, Args...> >,
524  pack_element_t<sizeof...(Args)-1, Args...>, cache_aligned_allocator<T> >
525 >;
526 }
527 
528 // Deduction guide for the constructor from two iterators
529 template<typename InputIterator,
530  typename T = typename std::iterator_traits<InputIterator>::value_type,
531  typename... Args
532 > concurrent_priority_queue(InputIterator, InputIterator, Args...)
533 -> internal::priority_queue_t<T, Args...>;
534 
535 template<typename T, typename CompareOrAllocalor>
536 concurrent_priority_queue(std::initializer_list<T> init_list, CompareOrAllocalor)
537 -> internal::priority_queue_t<T, CompareOrAllocalor>;
538 
539 #endif /* __TBB_CPP17_DEDUCTION_GUIDES_PRESENT */
540 } // namespace interface5
541 
542 using interface5::concurrent_priority_queue;
543 
544 } // namespace tbb
545 
546 #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 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(const concurrent_priority_queue &src, const allocator_type &a)
Copy constructor with specific allocator.
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 reheap()
Re-heapify after an extraction.
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:305
concurrent_priority_queue(InputIterator begin, InputIterator end, const allocator_type &a=allocator_type())
[begin,end) constructor
void heapify()
Merge unsorted elements into heap.
concurrent_priority_queue & operator=(const concurrent_priority_queue &src)
Assignment operator.
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:713
void push(value_type &&elem)
Pushes elem onto the queue, increasing capacity of queue if necessary.
void itt_hide_store_word(T &dst, T src)
size_t size_type
Integral type for representing size of the queue.
#define __TBB_CATCH(e)
Definition: tbb_stddef.h:284
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
const size_t NFS_MaxLineSize
Compile-time constant that is upper bound on cache line/sector size.
Definition: tbb_stddef.h:216
ptrdiff_t difference_type
Difference type for iterator.
T itt_hide_load_word(const T &src)
The graph class.
#define __TBB_TRY
Definition: tbb_stddef.h:283
size_type mark
The point at which unsorted elements begin.
Class for determining type of std::allocator<T>::value_type.
Definition: tbb_stddef.h:450
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
concurrent_priority_queue(InputIterator begin, InputIterator end, const Compare &c, const allocator_type &a=allocator_type())
[begin,end) constructor
void call_itt_notify(notify_type, void *)
concurrent_priority_queue(size_type init_capacity, const Compare &c, const allocator_type &a=allocator_type())
Constructs a new concurrent_priority_queue with init_sz capacity.
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
concurrent_priority_queue(concurrent_priority_queue &&src)
Move constructor.
void push_back_helper(const T &, tbb::internal::false_type)
concurrent_priority_queue(std::initializer_list< T > init_list, const Compare &c, const allocator_type &a=allocator_type())
Constructor from std::initializer_list.
concurrent_priority_queue(size_type init_capacity, const allocator_type &a=allocator_type())
Constructs a new concurrent_priority_queue with init_sz capacity.
void itt_store_word_with_release(tbb::atomic< T > &dst, U src)
bool try_pop(reference elem)
Gets a reference to and removes highest priority element.
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
void swap(concurrent_priority_queue &q)
Swap this queue with another; not thread-safe.
size_type size() const
Returns the current number of elements contained in the queue.
concurrent_priority_queue(const Compare &c, const allocator_type &a=allocator_type())
Constructs a new concurrent_priority_queue with default capacity.
tbb::internal::aggregator< my_functor_t, cpq_operation > aggregator_t
allocator_type get_allocator() const
Return allocator object.
void swap(atomic< T > &lhs, atomic< T > &rhs)
Definition: atomic.h:535
my_functor_t(concurrent_priority_queue< T, Compare, A > *cpq_)
#define __TBB_ALLOCATOR_TRAITS_PRESENT
Definition: tbb_config.h:338
void assign(InputIterator begin, InputIterator end)
Assign the queue from [begin,end) range, not thread-safe.
concurrent_priority_queue & operator=(std::initializer_list< T > il)
Assign from std::initializer_list, not thread-safe.
void clear()
Clear the queue; not thread-safe.
void throw_exception(exception_id eid)
Versionless convenience wrapper for throw_exception_v4()
void push(const_reference elem)
Pushes elem onto the queue, increasing capacity of queue if necessary.
bool empty() const
Returns true if empty, false otherwise.
concurrent_priority_queue(const concurrent_priority_queue &src)
Copy constructor.
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.
std::vector< value_type, allocator_type > vector_t
Storage for the heap of elements in queue, plus unheapified elements.
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 & operator=(concurrent_priority_queue &&src)
Move assignment operator.
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 type
concurrent_priority_queue(const allocator_type &a=allocator_type())
Constructs a new concurrent_priority_queue with default capacity.
void push_back_helper(const T &t, tbb::internal::true_type)
T __TBB_load_with_acquire(const volatile T &location)
Definition: tbb_machine.h:709
#define __TBB_atomic
Definition: tbb_stddef.h:237
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
void swap(concurrent_hash_map< Key, T, HashCompare, A > &a, concurrent_hash_map< Key, T, HashCompare, A > &b)
Identifiers declared inside namespace internal should never be used directly by client code.
Definition: atomic.h:51
#define __TBB_STATIC_ASSERT(condition, msg)
Definition: tbb_stddef.h:532

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.