proxygen
|
#include <folly/concurrency/DynamicBoundedQueue.h>
#include <folly/MPMCQueue.h>
#include <folly/ProducerConsumerQueue.h>
#include <folly/portability/GTest.h>
#include <glog/logging.h>
#include <atomic>
#include <thread>
Go to the source code of this file.
Classes | |
class | MPMC< T > |
class | PCQ< T > |
struct | IntArray< M > |
Typedefs | |
template<typename T , bool MayBlock, typename WeightFn > | |
using | DSPSC = folly::DSPSCQueue< T, MayBlock, 8, 7, WeightFn > |
template<typename T , bool MayBlock, typename WeightFn > | |
using | DMPSC = folly::DMPSCQueue< T, MayBlock, 8, 7, WeightFn > |
template<typename T , bool MayBlock, typename WeightFn > | |
using | DSPMC = folly::DSPMCQueue< T, MayBlock, 8, 7, WeightFn > |
template<typename T , bool MayBlock, typename WeightFn > | |
using | DMPMC = folly::DMPMCQueue< T, MayBlock, 8, 7, WeightFn > |
template<typename T , bool , typename > | |
using | FMPMC = MPMC< T > |
template<typename T , bool , typename > | |
using | FPCQ = PCQ< T > |
Functions | |
DEFINE_bool (bench, false,"run benchmark") | |
DEFINE_int32 (reps, 10,"number of reps") | |
DEFINE_int32 (ops, 1000000,"number of operations per rep") | |
DEFINE_int64 (capacity, 1000000,"capacity") | |
template<template< typename, bool, typename > class Q, bool MayBlock> | |
void | basic_test () |
TEST (DynamicBoundedQueue, basic) | |
template<template< typename, bool, typename > class Q, bool MayBlock> | |
void | move_test () |
TEST (DynamicBoundedQueue, move) | |
template<template< typename, bool, typename > class Q, bool MayBlock> | |
void | capacity_test () |
TEST (DynamicBoundedQueue, capacity) | |
template<typename ProdFunc , typename ConsFunc , typename EndFunc > | |
uint64_t | run_once (int nprod, int ncons, const ProdFunc &prodFn, const ConsFunc &consFn, const EndFunc &endFn) |
template<bool SingleProducer, bool SingleConsumer, bool MayBlock> | |
void | enq_deq_test (const int nprod, const int ncons) |
TEST (DynamicBoundedQueue, enq_deq) | |
template<typename RepFunc > | |
uint64_t | runBench (const std::string &name, int ops, const RepFunc &repFn) |
template<template< typename, bool, typename > class Q, typename T , int Op> | |
uint64_t | bench (const int nprod, const int ncons, const std::string &name) |
void | dottedLine () |
template<typename T > | |
void | type_benches (const int np, const int nc, const std::string &name) |
void | benches (const int np, const int nc) |
TEST (DynamicBoundedQueue, bench) | |
using DMPMC = folly::DMPMCQueue<T, MayBlock, 8, 7, WeightFn> |
Definition at line 42 of file DynamicBoundedQueueTest.cpp.
using DMPSC = folly::DMPSCQueue<T, MayBlock, 8, 7, WeightFn> |
Definition at line 36 of file DynamicBoundedQueueTest.cpp.
using DSPMC = folly::DSPMCQueue<T, MayBlock, 8, 7, WeightFn> |
Definition at line 39 of file DynamicBoundedQueueTest.cpp.
using DSPSC = folly::DSPSCQueue<T, MayBlock, 8, 7, WeightFn> |
Definition at line 33 of file DynamicBoundedQueueTest.cpp.
Definition at line 474 of file DynamicBoundedQueueTest.cpp.
Definition at line 515 of file DynamicBoundedQueueTest.cpp.
void basic_test | ( | ) |
Definition at line 45 of file DynamicBoundedQueueTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, ASSERT_TRUE, now(), uint64_t, v, and val.
uint64_t bench | ( | const int | nprod, |
const int | ncons, | ||
const std::string & | name | ||
) |
Definition at line 372 of file DynamicBoundedQueueTest.cpp.
References ASSERT_EQ, i, ops, run_once(), runBench(), sum(), T, uint64_t, and v.
void benches | ( | const int | np, |
const int | nc | ||
) |
void capacity_test | ( | ) |
Definition at line 142 of file DynamicBoundedQueueTest.cpp.
References ASSERT_EQ, ASSERT_FALSE, ASSERT_TRUE, uint64_t, v, and val.
DEFINE_int32 | ( | reps | , |
10 | , | ||
"number of reps" | |||
) |
DEFINE_int32 | ( | ops | , |
1000000 | , | ||
"number of operations per rep" | |||
) |
DEFINE_int64 | ( | capacity | , |
1000000 | , | ||
"capacity" | |||
) |
void dottedLine | ( | ) |
Definition at line 531 of file DynamicBoundedQueueTest.cpp.
Referenced by TEST(), and type_benches().
void enq_deq_test | ( | const int | nprod, |
const int | ncons | ||
) |
Definition at line 241 of file DynamicBoundedQueueTest.cpp.
References ASSERT_EQ, folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::dequeue(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::enqueue(), i, ops, run_once(), sum(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::try_dequeue(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::try_dequeue_for(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::try_enqueue(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::try_enqueue_for(), uint64_t, and v.
void move_test | ( | ) |
Definition at line 97 of file DynamicBoundedQueueTest.cpp.
References ASSERT_EQ, ASSERT_TRUE, folly::gen::move, folly::pushmi::__adl::noexcept(), now(), uint64_t, and v.
|
inline |
Definition at line 183 of file DynamicBoundedQueueTest.cpp.
References count, i, now(), and start.
Referenced by bench(), and enq_deq_test().
uint64_t runBench | ( | const std::string & | name, |
int | ops, | ||
const RepFunc & | repFn | ||
) |
TEST | ( | DynamicBoundedQueue | , |
basic | |||
) |
Definition at line 85 of file DynamicBoundedQueueTest.cpp.
TEST | ( | DynamicBoundedQueue | , |
move | |||
) |
Definition at line 130 of file DynamicBoundedQueueTest.cpp.
TEST | ( | DynamicBoundedQueue | , |
capacity | |||
) |
Definition at line 171 of file DynamicBoundedQueueTest.cpp.
TEST | ( | DynamicBoundedQueue | , |
enq_deq | |||
) |
Definition at line 304 of file DynamicBoundedQueueTest.cpp.
TEST | ( | DynamicBoundedQueue | , |
bench | |||
) |
void type_benches | ( | const int | np, |
const int | nc, | ||
const std::string & | name | ||
) |