8#ifndef INCLUDED_BDLMT_FIXEDTHREADPOOL
9#define INCLUDED_BDLMT_FIXEDTHREADPOOL
351#include <bdlscm_version.h>
374#include <bsl_cstdlib.h>
375#include <bsl_functional.h>
376#include <bsl_string.h>
378#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
385#include <bsl_algorithm.h>
391#ifndef BDE_OMIT_INTERNAL_DEPRECATED
433#ifndef BDE_OMIT_INTERNAL_DEPRECATED
443 static const char s_defaultThreadName[16];
468 const int d_numThreads;
471#if defined(BSLS_PLATFORM_OS_UNIX)
481 d_usedCapacityHandle;
499 int startNewThread();
516 int maxNumPendingJobs,
531 int maxNumPendingJobs,
546 int maxNumPendingJobs,
563 int maxNumPendingJobs,
734 return enqueueJob(bdlf::BindUtil::bindR<void>(function, userData));
759 return tryEnqueueJob(bdlf::BindUtil::bindR<void>(function, userData));
816 return d_numThreads == d_threadGroup.
numThreads();
846 return static_cast<int>(d_queue.
capacity());
Definition bdlcc_boundedqueue.h:415
bsl::size_t capacity() const
Definition bdlcc_boundedqueue.h:1381
int waitUntilEmpty() const
Definition bdlcc_boundedqueue.h:1422
void enablePushBack()
Definition bdlcc_boundedqueue.h:1373
void removeAll()
Definition bdlcc_boundedqueue.h:1179
void enablePopFront()
Definition bdlcc_boundedqueue.h:1366
@ e_FAILED
Definition bdlcc_boundedqueue.h:619
@ e_DISABLED
Definition bdlcc_boundedqueue.h:618
@ e_SUCCESS
Definition bdlcc_boundedqueue.h:615
@ e_FULL
Definition bdlcc_boundedqueue.h:617
void disablePopFront()
Definition bdlcc_boundedqueue.h:1347
int pushBack(const TYPE &value)
Definition bdlcc_boundedqueue.h:1106
bsl::size_t numElements() const
Definition bdlcc_boundedqueue.h:1416
bool isPushBackDisabled() const
Definition bdlcc_boundedqueue.h:1409
int tryPushBack(const TYPE &value)
Definition bdlcc_boundedqueue.h:1265
void disablePushBack()
Definition bdlcc_boundedqueue.h:1359
Definition bdlm_metricsregistry.h:287
Definition bdlm_metricsregistry.h:199
Definition bdlmt_fixedthreadpool.h:413
int numActiveThreads() const
Definition bdlmt_fixedthreadpool.h:820
void shutdown()
Definition bdlmt_fixedthreadpool.h:781
int tryEnqueueJob(const Job &functor)
Definition bdlmt_fixedthreadpool.h:738
bdlcc::BoundedQueue< Job > Queue
Definition bdlmt_fixedthreadpool.h:418
void disable()
Definition bdlmt_fixedthreadpool.h:701
@ e_SUSPEND
Definition bdlmt_fixedthreadpool.h:431
@ e_DRAIN
Definition bdlmt_fixedthreadpool.h:432
@ BCEP_RUN
Definition bdlmt_fixedthreadpool.h:435
@ e_STOP
Definition bdlmt_fixedthreadpool.h:429
@ e_RUN
Definition bdlmt_fixedthreadpool.h:430
@ BCEP_SUSPEND
Definition bdlmt_fixedthreadpool.h:436
@ BCEP_DRAIN
Definition bdlmt_fixedthreadpool.h:437
@ BCEP_STOP
Definition bdlmt_fixedthreadpool.h:434
bsl::function< void()> Job
Definition bdlmt_fixedthreadpool.h:417
FixedThreadPool(const bslmt::ThreadAttributes &threadAttributes, int numThreads, int maxNumPendingJobs, const bsl::string_view &threadPoolName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
FixedThreadPool(int numThreads, int maxNumPendingJobs, const bsl::string_view &threadPoolName, bdlm::MetricsRegistry *metricsRegistry, bslma::Allocator *basicAllocator=0)
int numThreads() const
Definition bdlmt_fixedthreadpool.h:832
int queueCapacity() const
Definition bdlmt_fixedthreadpool.h:844
bool isStarted() const
Definition bdlmt_fixedthreadpool.h:814
void enable()
Definition bdlmt_fixedthreadpool.h:707
bool isEnabled() const
Definition bdlmt_fixedthreadpool.h:808
int numThreadsStarted() const
Definition bdlmt_fixedthreadpool.h:838
@ e_FULL
Definition bdlmt_fixedthreadpool.h:423
@ e_FAILED
Definition bdlmt_fixedthreadpool.h:425
@ e_SUCCESS
Definition bdlmt_fixedthreadpool.h:422
@ e_DISABLED
Definition bdlmt_fixedthreadpool.h:424
void drain()
Definition bdlmt_fixedthreadpool.h:763
int enqueueJob(const Job &functor)
Definition bdlmt_fixedthreadpool.h:713
int numPendingJobs() const
Definition bdlmt_fixedthreadpool.h:826
void stop()
Definition bdlmt_fixedthreadpool.h:794
FixedThreadPool(int numThreads, int maxNumPendingJobs, bslma::Allocator *basicAllocator=0)
FixedThreadPool(const bslmt::ThreadAttributes &threadAttributes, int numThreads, int maxNumPendingJobs, bslma::Allocator *basicAllocator=0)
Definition bslstl_stringview.h:441
Forward declaration.
Definition bslstl_function.h:934
Definition bslma_allocator.h:457
Definition bslmf_movableref.h:751
Definition bslmt_barrier.h:353
Definition bslmt_lockguard.h:234
Definition bslmt_mutex.h:315
Definition bslmt_threadattributes.h:356
Definition bslmt_threadgroup.h:156
int numThreads() const
Definition bslmt_threadgroup.h:299
Definition bsls_atomic.h:1472
Definition bsls_atomic.h:743
int loadAcquire() const
Definition bsls_atomic.h:1732
void(* bcep_FixedThreadPoolJobFunc)(void *)
Definition bdlmt_fixedthreadpool.h:393
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlmt_eventscheduler.h:522
void(* FixedThreadPoolJobFunc)(void *)
Definition bdlmt_fixedthreadpool.h:403
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1060
static t_TYPE & access(t_TYPE &ref) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1032