Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::interface5 Namespace Reference

Namespaces

 internal
 

Classes

class  concurrent_hash_map
 Unordered map from Key to T. More...
 
class  concurrent_priority_queue
 Concurrent priority queue. More...
 
class  concurrent_unordered_map
 
class  concurrent_unordered_map_traits
 
class  concurrent_unordered_multimap
 
class  concurrent_unordered_multiset
 
class  concurrent_unordered_set
 
class  concurrent_unordered_set_traits
 
class  reader_writer_lock
 Writer-preference reader-writer lock with local-only spinning on readers. More...
 

Functions

template<typename T >
size_t tbb_hasher (const T &t)
 Hasher functions. More...
 
template<typename P >
size_t tbb_hasher (P *ptr)
 
template<typename E , typename S , typename A >
size_t tbb_hasher (const std::basic_string< E, S, A > &s)
 
template<typename F , typename S >
size_t tbb_hasher (const std::pair< F, S > &p)
 
uintptr_t fetch_and_or (atomic< uintptr_t > &operand, uintptr_t value)
 
uintptr_t fetch_and_and (atomic< uintptr_t > &operand, uintptr_t value)
 
template<typename T , typename U >
void spin_wait_while_geq (const volatile T &location, U value)
 Spin WHILE the value at the location is greater than or equal to a given value. More...
 
template<typename T , typename U >
void spin_wait_until_and (const volatile T &location, U value)
 Spin UNTIL (location & value) is true. More...
 

Variables

const uintptr_t WFLAG1 = 0x1
 
const uintptr_t WFLAG2 = 0x2
 
const uintptr_t RFLAG = 0x4
 
const uintptr_t RC_INCR = 0x8
 

Function Documentation

◆ fetch_and_and()

uintptr_t tbb::interface5::fetch_and_and ( atomic< uintptr_t > &  operand,
uintptr_t  value 
)
inline

Definition at line 46 of file reader_writer_lock.cpp.

References tbb::internal::atomic_impl< T >::compare_and_swap(), and tbb::internal::atomic_backoff::pause().

Referenced by tbb::interface5::reader_writer_lock::end_write().

46  {
48  uintptr_t old = operand;
49  uintptr_t result = operand.compare_and_swap(old&value, old);
50  if (result==old) return result;
51  }
52 }
Class that implements exponential backoff.
Definition: tbb_machine.h:348
void pause()
Pause for a while.
Definition: tbb_machine.h:363
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
value_type compare_and_swap(value_type value, value_type comparand)
Definition: atomic.h:285
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fetch_and_or()

uintptr_t tbb::interface5::fetch_and_or ( atomic< uintptr_t > &  operand,
uintptr_t  value 
)
inline

Definition at line 37 of file reader_writer_lock.cpp.

References tbb::internal::atomic_impl< T >::compare_and_swap(), and tbb::internal::atomic_backoff::pause().

Referenced by tbb::interface5::reader_writer_lock::set_next_writer(), and tbb::interface5::reader_writer_lock::start_read().

37  {
39  uintptr_t old = operand;
40  uintptr_t result = operand.compare_and_swap(old|value, old);
41  if (result==old) return result;
42  }
43 }
Class that implements exponential backoff.
Definition: tbb_machine.h:348
void pause()
Pause for a while.
Definition: tbb_machine.h:363
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
value_type compare_and_swap(value_type value, value_type comparand)
Definition: atomic.h:285
Here is the call graph for this function:
Here is the caller graph for this function:

◆ spin_wait_until_and()

template<typename T , typename U >
void tbb::interface5::spin_wait_until_and ( const volatile T &  location,
value 
)

Spin UNTIL (location & value) is true.

T and U should be comparable types.

Definition at line 65 of file reader_writer_lock.cpp.

References tbb::internal::atomic_backoff::pause().

Referenced by tbb::interface5::reader_writer_lock::set_next_writer().

65  {
67  while( !(location & value) ) backoff.pause();
68 }
Class that implements exponential backoff.
Definition: tbb_machine.h:348
void pause()
Pause for a while.
Definition: tbb_machine.h:363
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ spin_wait_while_geq()

template<typename T , typename U >
void tbb::interface5::spin_wait_while_geq ( const volatile T &  location,
value 
)

Spin WHILE the value at the location is greater than or equal to a given value.

T and U should be comparable types.

Definition at line 57 of file reader_writer_lock.cpp.

References tbb::internal::atomic_backoff::pause().

Referenced by tbb::interface5::reader_writer_lock::set_next_writer().

57  {
59  while( location>=value ) backoff.pause();
60 }
Class that implements exponential backoff.
Definition: tbb_machine.h:348
void pause()
Pause for a while.
Definition: tbb_machine.h:363
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tbb_hasher() [1/4]

template<typename T >
size_t tbb::interface5::tbb_hasher ( const T &  t)
inline

Hasher functions.

Definition at line 61 of file _tbb_hash_compare_impl.h.

References tbb::interface5::internal::hash_multiplier.

Referenced by tbb::tbb_hash_compare< Key >::hash(), tbb::tbb_hash< Key >::operator()(), and tbb_hasher().

61  {
62  return static_cast<size_t>( t ) * internal::hash_multiplier;
63 }
static const size_t hash_multiplier
Hash multiplier.
Here is the caller graph for this function:

◆ tbb_hasher() [2/4]

template<typename P >
size_t tbb::interface5::tbb_hasher ( P *  ptr)
inline

Definition at line 65 of file _tbb_hash_compare_impl.h.

References h.

65  {
66  size_t const h = reinterpret_cast<size_t>( ptr );
67  return (h >> 3) ^ h;
68 }
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 h

◆ tbb_hasher() [3/4]

template<typename E , typename S , typename A >
size_t tbb::interface5::tbb_hasher ( const std::basic_string< E, S, A > &  s)
inline

Definition at line 70 of file _tbb_hash_compare_impl.h.

References h, and tbb::interface5::internal::hash_multiplier.

70  {
71  size_t h = 0;
72  for( const E* c = s.c_str(); *c; ++c )
73  h = static_cast<size_t>(*c) ^ (h * internal::hash_multiplier);
74  return h;
75 }
static const size_t hash_multiplier
Hash multiplier.
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 h

◆ tbb_hasher() [4/4]

template<typename F , typename S >
size_t tbb::interface5::tbb_hasher ( const std::pair< F, S > &  p)
inline

Definition at line 77 of file _tbb_hash_compare_impl.h.

References tbb_hasher().

77  {
78  return tbb_hasher(p.first) ^ tbb_hasher(p.second);
79 }
size_t tbb_hasher(const std::pair< F, S > &p)
void const char const char int ITT_FORMAT __itt_group_sync p
Here is the call graph for this function:

Variable Documentation

◆ RC_INCR

◆ RFLAG

const uintptr_t tbb::interface5::RFLAG = 0x4

◆ WFLAG1

const uintptr_t tbb::interface5::WFLAG1 = 0x1

Definition at line 30 of file reader_writer_lock.cpp.

◆ WFLAG2

const uintptr_t tbb::interface5::WFLAG2 = 0x2

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.