8#ifndef INCLUDED_BDLMT_FIXEDTHREADPOOL
9#define INCLUDED_BDLMT_FIXEDTHREADPOOL
366#include <bdlscm_version.h>
391#include <bsl_cstdlib.h>
392#include <bsl_functional.h>
393#include <bsl_string.h>
395#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
402#include <bsl_algorithm.h>
442#ifndef BDE_OMIT_INTERNAL_DEPRECATED
452 static const char s_defaultThreadName[16];
477 const int d_numThreads;
480#if defined(BSLS_PLATFORM_OS_UNIX)
490 d_usedCapacityHandle;
509 int startNewThread();
531 int maxNumPendingJobs,
550 int maxNumPendingJobs,
571 int maxNumPendingJobs,
594 int maxNumPendingJobs,
771 return enqueueJob(bdlf::BindUtil::bindR<void>(function, userData));
796 return tryEnqueueJob(bdlf::BindUtil::bindR<void>(function, userData));
853 return d_numThreads == d_threadGroup.
numThreads();
883 return static_cast<int>(d_queue.
capacity());
Definition bdlcc_boundedqueue.h:418
bsl::size_t capacity() const
Definition bdlcc_boundedqueue.h:1398
int waitUntilEmpty() const
Definition bdlcc_boundedqueue.h:1439
void enablePushBack()
Definition bdlcc_boundedqueue.h:1390
void removeAll()
Definition bdlcc_boundedqueue.h:1196
void enablePopFront()
Definition bdlcc_boundedqueue.h:1383
@ e_FAILED
Definition bdlcc_boundedqueue.h:630
@ e_DISABLED
Definition bdlcc_boundedqueue.h:629
@ e_SUCCESS
Definition bdlcc_boundedqueue.h:626
@ e_FULL
Definition bdlcc_boundedqueue.h:628
void disablePopFront()
Definition bdlcc_boundedqueue.h:1364
int pushBack(const TYPE &value)
Definition bdlcc_boundedqueue.h:1123
bsl::size_t numElements() const
Definition bdlcc_boundedqueue.h:1433
bool isPushBackDisabled() const
Definition bdlcc_boundedqueue.h:1426
int tryPushBack(const TYPE &value)
Definition bdlcc_boundedqueue.h:1282
void disablePushBack()
Definition bdlcc_boundedqueue.h:1376
Definition bdlm_metricsregistry.h:306
Definition bdlm_metricsregistry.h:197
Definition bdlmt_fixedthreadpool.h:422
int numActiveThreads() const
Definition bdlmt_fixedthreadpool.h:857
@ e_SUSPEND
Definition bdlmt_fixedthreadpool.h:440
@ e_DRAIN
Definition bdlmt_fixedthreadpool.h:441
@ BSLA_DEPRECATED
Definition bdlmt_fixedthreadpool.h:443
@ e_STOP
Definition bdlmt_fixedthreadpool.h:438
@ e_RUN
Definition bdlmt_fixedthreadpool.h:439
void shutdown()
Definition bdlmt_fixedthreadpool.h:818
int tryEnqueueJob(const Job &functor)
Definition bdlmt_fixedthreadpool.h:775
bdlcc::BoundedQueue< Job > Queue
Definition bdlmt_fixedthreadpool.h:427
void disable()
Definition bdlmt_fixedthreadpool.h:738
@ e_FULL
Definition bdlmt_fixedthreadpool.h:432
@ e_FAILED
Definition bdlmt_fixedthreadpool.h:434
@ e_SUCCESS
Definition bdlmt_fixedthreadpool.h:431
@ e_DISABLED
Definition bdlmt_fixedthreadpool.h:433
bsl::function< void()> Job
Definition bdlmt_fixedthreadpool.h:426
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:869
int queueCapacity() const
Definition bdlmt_fixedthreadpool.h:881
bool isStarted() const
Definition bdlmt_fixedthreadpool.h:851
void enable()
Definition bdlmt_fixedthreadpool.h:744
bool isEnabled() const
Definition bdlmt_fixedthreadpool.h:845
int numThreadsStarted() const
Definition bdlmt_fixedthreadpool.h:875
void drain()
Definition bdlmt_fixedthreadpool.h:800
int enqueueJob(const Job &functor)
Definition bdlmt_fixedthreadpool.h:750
int numPendingJobs() const
Definition bdlmt_fixedthreadpool.h:863
void stop()
Definition bdlmt_fixedthreadpool.h:831
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:471
Forward declaration.
Definition bslstl_function.h:946
Definition bslma_allocator.h:545
Definition bslmf_movableref.h:752
Definition bslmt_barrier.h:353
Definition bslmt_lockguard.h:234
Definition bslmt_mutex.h:317
Definition bslmt_threadattributes.h:361
Definition bslmt_threadgroup.h:156
int numThreads() const
Definition bslmt_threadgroup.h:301
Definition bsls_atomic.h:1490
Definition bsls_atomic.h:744
int loadAcquire() const
Definition bsls_atomic.h:1753
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlmt_eventscheduler.h:550
void(* FixedThreadPoolJobFunc)(void *)
Definition bdlmt_fixedthreadpool.h:412
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1067
static t_TYPE & access(t_TYPE &ref) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1039