proxygen
folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment Class Reference
Inheritance diagram for folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment:
folly::hazptr_obj_base_linked< Segment, Atom > folly::hazptr_obj_linked< Atom > folly::hazptr_deleter< Segment, D > folly::hazptr_obj< Atom >

Public Member Functions

 Segment (const Ticket t) noexcept
 
SegmentnextSegment () const noexcept
 
void setNextSegment (Segment *next)
 
bool casNextSegment (Segment *next) noexcept
 
FOLLY_ALWAYS_INLINE Ticket minTicket () const noexcept
 
FOLLY_ALWAYS_INLINE Entryentry (size_t index) noexcept
 
template<typename S >
void push_links (bool m, S &s)
 
- Public Member Functions inherited from folly::hazptr_obj_base_linked< Segment, Atom >
void retire ()
 
void unlink ()
 
void unlink_and_reclaim_unchecked ()
 
- Public Member Functions inherited from folly::hazptr_obj_linked< Atom >
void acquire_link () noexcept
 
void acquire_link_safe () noexcept
 
void acquire_ref () noexcept
 
void acquire_ref_safe () noexcept
 
- Public Member Functions inherited from folly::hazptr_obj< Atom >
 hazptr_obj () noexcept
 
 hazptr_obj (const hazptr_obj< Atom > &) noexcept
 
 hazptr_obj (hazptr_obj< Atom > &&) noexcept
 
hazptr_obj< Atom > & operator= (const hazptr_obj< Atom > &) noexcept
 
hazptr_obj< Atom > & operator= (hazptr_obj< Atom > &&) noexcept
 
- Public Member Functions inherited from folly::hazptr_deleter< Segment, D >
void set_deleter (D d={})
 
void delete_obj (Segment *p)
 

Private Attributes

Atom< Segment * > next_ {nullptr}
 
const Ticket min_
 
Entry b_ [SegmentSize]
 

Detailed Description

template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
class folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment

Segment

Definition at line 803 of file UnboundedQueue.h.

Constructor & Destructor Documentation

template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::Segment ( const Ticket  t)
inlineexplicitnoexcept

Definition at line 809 of file UnboundedQueue.h.

809 : min_(t) {}

Member Function Documentation

template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
bool folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::casNextSegment ( Segment next)
inlinenoexcept

Definition at line 819 of file UnboundedQueue.h.

References cpp.ast::next().

819  {
820  Segment* expected = nullptr;
821  return next_.compare_exchange_strong(
822  expected, next, std::memory_order_release, std::memory_order_relaxed);
823  }
Segment(const Ticket t) noexcept
hazptr_obj< Atom > * next() const noexcept
Definition: HazptrObj.h:86
template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
FOLLY_ALWAYS_INLINE Entry& folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::entry ( size_t  index)
inlinenoexcept

Definition at line 830 of file UnboundedQueue.h.

References folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::index().

830  {
831  return b_[index];
832  }
FOLLY_ALWAYS_INLINE size_t index(Ticket t) const noexcept
template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
FOLLY_ALWAYS_INLINE Ticket folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::minTicket ( ) const
inlinenoexcept

Definition at line 825 of file UnboundedQueue.h.

References min_.

825  {
826  DCHECK_EQ((min_ & (SegmentSize - 1)), Ticket(0));
827  return min_;
828  }
static constexpr size_t SegmentSize
template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
Segment* folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::nextSegment ( ) const
inlinenoexcept

Definition at line 811 of file UnboundedQueue.h.

811  {
812  return next_.load(std::memory_order_acquire);
813  }
template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
template<typename S >
void folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::push_links ( bool  m,
S s 
)
inline

Definition at line 835 of file UnboundedQueue.h.

References Atom, folly::constexpr_log2(), folly::hardware_destructive_interference_size, and folly::T.

835  {
836  if (m == false) { // next_ is immutable
837  auto p = nextSegment();
838  if (p) {
839  s.push(p);
840  }
841  }
842  }
static map< string, int > m
Segment * nextSegment() const noexcept
static set< string > s
template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
void folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::setNextSegment ( Segment next)
inline

Definition at line 815 of file UnboundedQueue.h.

815  {
816  next_.store(next, std::memory_order_relaxed);
817  }
hazptr_obj< Atom > * next() const noexcept
Definition: HazptrObj.h:86

Member Data Documentation

template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
Entry folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::b_[SegmentSize]
private

Definition at line 806 of file UnboundedQueue.h.

template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
const Ticket folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::min_
private

Definition at line 805 of file UnboundedQueue.h.

template<typename T, bool SingleProducer, bool SingleConsumer, bool MayBlock, size_t LgSegmentSize = 8, size_t LgAlign = constexpr_log2(hardware_destructive_interference_size), template< typename > class Atom = std::atomic>
Atom<Segment*> folly::UnboundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, Atom >::Segment::next_ {nullptr}
private

Definition at line 804 of file UnboundedQueue.h.


The documentation for this class was generated from the following file: