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 50 of file reader_writer_lock.cpp.

50  {
52  uintptr_t old = operand;
53  uintptr_t result = operand.compare_and_swap(old&value, old);
54  if (result==old) return result;
55  }
56 }
void pause()
Pause for a while.
Definition: tbb_machine.h:364
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
Class that implements exponential backoff.
Definition: tbb_machine.h:349
value_type compare_and_swap(value_type value, value_type comparand)
Definition: atomic.h:289

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

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

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 41 of file reader_writer_lock.cpp.

41  {
43  uintptr_t old = operand;
44  uintptr_t result = operand.compare_and_swap(old|value, old);
45  if (result==old) return result;
46  }
47 }
void pause()
Pause for a while.
Definition: tbb_machine.h:364
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
Class that implements exponential backoff.
Definition: tbb_machine.h:349
value_type compare_and_swap(value_type value, value_type comparand)
Definition: atomic.h:289

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

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

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 69 of file reader_writer_lock.cpp.

69  {
71  while( !(location & value) ) backoff.pause();
72 }
void pause()
Pause for a while.
Definition: tbb_machine.h:364
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
Class that implements exponential backoff.
Definition: tbb_machine.h:349

References tbb::internal::atomic_backoff::pause(), and value.

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

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 61 of file reader_writer_lock.cpp.

61  {
63  while( location>=value ) backoff.pause();
64 }
void pause()
Pause for a while.
Definition: tbb_machine.h:364
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
Class that implements exponential backoff.
Definition: tbb_machine.h:349

References tbb::internal::atomic_backoff::pause(), and value.

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

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 65 of file _tbb_hash_compare_impl.h.

65  {
66  return static_cast<size_t>( t ) * internal::hash_multiplier;
67 }
static const size_t hash_multiplier
Hash multiplier.

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

Referenced by tbb_hasher().

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 69 of file _tbb_hash_compare_impl.h.

69  {
70  size_t const h = reinterpret_cast<size_t>( ptr );
71  return (h >> 3) ^ h;
72 }
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

References 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 74 of file _tbb_hash_compare_impl.h.

74  {
75  size_t h = 0;
76  for( const E* c = s.c_str(); *c; ++c )
77  h = static_cast<size_t>(*c) ^ (h * internal::hash_multiplier);
78  return h;
79 }
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
static const size_t hash_multiplier
Hash multiplier.
void const char const char int ITT_FORMAT __itt_group_sync s

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

◆ 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 81 of file _tbb_hash_compare_impl.h.

81  {
82  return tbb_hasher(p.first) ^ tbb_hasher(p.second);
83 }
size_t tbb_hasher(const std::pair< F, S > &p)
void const char const char int ITT_FORMAT __itt_group_sync p

References p, and tbb_hasher().

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

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ RC_INCR

◆ RFLAG

◆ WFLAG1

◆ WFLAG2


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.