Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
A queue using simple locking. More...
#include <_concurrent_queue_impl.h>
Classes | |
class | destroyer |
Class used to ensure exception-safety of method "pop". More... | |
struct | padded_page |
Public Types | |
typedef void(* | item_constructor_t) (T *location, const void *src) |
Public Member Functions | |
void | push (const void *item, ticket k, concurrent_queue_base_v3< T > &base, item_constructor_t construct_item) |
bool | pop (void *dst, ticket k, concurrent_queue_base_v3< T > &base) |
micro_queue & | assign (const micro_queue &src, concurrent_queue_base_v3< T > &base, item_constructor_t construct_item) |
page * | make_copy (concurrent_queue_base_v3< T > &base, const page *src_page, size_t begin_in_page, size_t end_in_page, ticket &g_index, item_constructor_t construct_item) |
void | invalidate_page_and_rethrow (ticket k) |
Static Public Member Functions | |
static T & | get_ref (page &p, size_t index) |
Public Attributes | |
atomic< page * > | head_page |
atomic< ticket > | head_counter |
atomic< page * > | tail_page |
atomic< ticket > | tail_counter |
spin_mutex | page_mutex |
Private Types | |
typedef concurrent_queue_rep_base::page | page |
Private Member Functions | |
void | copy_item (page &dst, size_t dindex, const void *src, item_constructor_t construct_item) |
void | copy_item (page &dst, size_t dindex, const page &src, size_t sindex, item_constructor_t construct_item) |
void | assign_and_destroy_item (void *dst, page &src, size_t index) |
void | spin_wait_until_my_turn (atomic< ticket > &counter, ticket k, concurrent_queue_rep_base &rb) const |
![]() | |
no_copy (const no_copy &)=delete | |
no_copy ()=default | |
Friends | |
class | micro_queue_pop_finalizer< T > |
A queue using simple locking.
For efficiency, this class has no constructor. The caller is expected to zero-initialize it.
Definition at line 131 of file _concurrent_queue_impl.h.
typedef void(* tbb::strict_ppl::internal::micro_queue< T >::item_constructor_t) (T *location, const void *src) |
Definition at line 133 of file _concurrent_queue_impl.h.
|
private |
Definition at line 135 of file _concurrent_queue_impl.h.
micro_queue< T > & tbb::strict_ppl::internal::micro_queue< T >::assign | ( | const micro_queue< T > & | src, |
concurrent_queue_base_v3< T > & | base, | ||
item_constructor_t | construct_item | ||
) |
Definition at line 286 of file _concurrent_queue_impl.h.
References __TBB_ASSERT, __TBB_CATCH, __TBB_TRY, tbb::strict_ppl::internal::micro_queue< T >::head_counter, tbb::strict_ppl::internal::micro_queue< T >::head_page, tbb::strict_ppl::internal::is_valid_page(), tbb::internal::modulo_power_of_two(), tbb::strict_ppl::internal::concurrent_queue_base_v3< T >::my_rep, tbb::strict_ppl::internal::concurrent_queue_rep_base::n_queue, tbb::strict_ppl::internal::concurrent_queue_rep_base::page::next, tbb::strict_ppl::internal::micro_queue< T >::tail_counter, and tbb::strict_ppl::internal::micro_queue< T >::tail_page.
|
inlineprivate |
Definition at line 156 of file _concurrent_queue_impl.h.
References d, and tbb::move().
|
inlineprivate |
Definition at line 149 of file _concurrent_queue_impl.h.
|
inlineprivate |
Definition at line 145 of file _concurrent_queue_impl.h.
|
inlinestatic |
Definition at line 176 of file _concurrent_queue_impl.h.
References tbb::internal::last(), and p.
Referenced by tbb::strict_ppl::internal::concurrent_queue_iterator_rep< T >::get_item().
void tbb::strict_ppl::internal::micro_queue< T >::invalidate_page_and_rethrow | ( | ticket | k | ) |
Definition at line 327 of file _concurrent_queue_impl.h.
References __TBB_RETHROW, tbb::strict_ppl::internal::is_valid_page(), tbb::internal::itt_store_word_with_release(), lock, tbb::strict_ppl::internal::concurrent_queue_rep_base::n_queue, and tbb::strict_ppl::internal::concurrent_queue_rep_base::page::next.
concurrent_queue_rep_base::page * tbb::strict_ppl::internal::micro_queue< T >::make_copy | ( | concurrent_queue_base_v3< T > & | base, |
const page * | src_page, | ||
size_t | begin_in_page, | ||
size_t | end_in_page, | ||
ticket & | g_index, | ||
item_constructor_t | construct_item | ||
) |
Definition at line 344 of file _concurrent_queue_impl.h.
References tbb::strict_ppl::internal::concurrent_queue_page_allocator::allocate_page(), tbb::strict_ppl::internal::concurrent_queue_rep_base::page::mask, and tbb::strict_ppl::internal::concurrent_queue_rep_base::page::next.
bool tbb::strict_ppl::internal::micro_queue< T >::pop | ( | void * | dst, |
ticket | k, | ||
concurrent_queue_base_v3< T > & | base | ||
) |
Definition at line 263 of file _concurrent_queue_impl.h.
References __TBB_ASSERT, tbb::internal::acquired, tbb::internal::call_itt_notify(), tbb::internal::modulo_power_of_two(), tbb::strict_ppl::internal::concurrent_queue_base_v3< T >::my_rep, tbb::strict_ppl::internal::concurrent_queue_rep_base::n_queue, p, tbb::internal::spin_wait_until_eq(), and tbb::internal::spin_wait_while_eq().
void tbb::strict_ppl::internal::micro_queue< T >::push | ( | const void * | item, |
ticket | k, | ||
concurrent_queue_base_v3< T > & | base, | ||
item_constructor_t | construct_item | ||
) |
Definition at line 215 of file _concurrent_queue_impl.h.
References __TBB_CATCH, __TBB_RETHROW, __TBB_TRY, tbb::internal::acquired, tbb::strict_ppl::internal::concurrent_queue_page_allocator::allocate_page(), tbb::internal::call_itt_notify(), tbb::strict_ppl::internal::is_valid_page(), tbb::internal::itt_hide_store_word(), lock, tbb::internal::modulo_power_of_two(), tbb::strict_ppl::internal::concurrent_queue_base_v3< T >::my_rep, tbb::strict_ppl::internal::concurrent_queue_rep_base::n_queue, tbb::strict_ppl::internal::concurrent_queue_rep_base::page::next, p, and tbb::internal::releasing.
|
private |
Definition at line 203 of file _concurrent_queue_impl.h.
References tbb::internal::eid_bad_last_alloc, tbb::strict_ppl::internal::concurrent_queue_rep_base::n_invalid_entries, tbb::internal::atomic_backoff::pause(), and tbb::internal::throw_exception().
|
friend |
Definition at line 162 of file _concurrent_queue_impl.h.
atomic<ticket> tbb::strict_ppl::internal::micro_queue< T >::head_counter |
Definition at line 181 of file _concurrent_queue_impl.h.
Referenced by tbb::strict_ppl::internal::micro_queue< T >::assign().
atomic<page*> tbb::strict_ppl::internal::micro_queue< T >::head_page |
Definition at line 180 of file _concurrent_queue_impl.h.
Referenced by tbb::strict_ppl::internal::micro_queue< T >::assign().
spin_mutex tbb::strict_ppl::internal::micro_queue< T >::page_mutex |
Definition at line 186 of file _concurrent_queue_impl.h.
atomic<ticket> tbb::strict_ppl::internal::micro_queue< T >::tail_counter |
Definition at line 184 of file _concurrent_queue_impl.h.
Referenced by tbb::strict_ppl::internal::micro_queue< T >::assign().
atomic<page*> tbb::strict_ppl::internal::micro_queue< T >::tail_page |
Definition at line 183 of file _concurrent_queue_impl.h.
Referenced by tbb::strict_ppl::internal::micro_queue< T >::assign().