<commit_before>// bdlmt_multiqueuethreadpool.h                                       -*-C++-*-

// ----------------------------------------------------------------------------
//                                   NOTICE
//
// This component is not up to date with current BDE coding standards, and
// should not be used as an example for new development.
// ----------------------------------------------------------------------------

#ifndef INCLUDED_BDLMT_MULTIQUEUETHREADPOOL
#define INCLUDED_BDLMT_MULTIQUEUETHREADPOOL

#ifndef INCLUDED_BSLS_IDENT
#include <bsls_ident.h>
#endif
BSLS_IDENT("$Id: $")

//@PURPOSE: Provide a pool of queues, each processed serially by a thread pool.
//
//@CLASSES:
// bdlmt::MultiQueueThreadPool: multi-threaded, serial processing of queues
//
//@SEE_ALSO: bdlmt_threadpool
//
//@DESCRIPTION: This component defines a dynamic, configurable pool of queues,
// each of which is processed by a thread in a thread pool, such that elements
// on a given queue are processed serially, regardless of which thread is
// processing the queue at a given time.
//
// A 'bdlmt::MultiQueueThreadPool' allows clients to create and delete queues,
// and to enqueue "jobs" (represented as client-specified functors) to specific
// queues.  Queue processing is implemented on top of a 'bdlmt::ThreadPool' by
// enqueuing a per-queue functor to the thread pool.  Each functor dequeues
// the next item from its associated queue, processes it, and re-enqueues
// itself to the thread pool.  Since there is only one representative functor
// per queue, each queue is guaranteed to be processed serially by the thread
// pool.
//
// In addition to the ability to create and delete queues, clients are able to
// tune the underlying thread pool in accordance with the 'bdlmt::ThreadPool'
// documentation.
//
///Thread Safety
///-------------
// The 'bdlmt::MultiQueueThreadPool' class is *thread-aware*, but not *fully
// thread-safe*.  The function-level documentation identifies methods (i.e.,
// the 'reset' method) that cannot be safely used by multiple threads.  This
// class is also *thread-enabled* (i.e., the class does not function correctly
// in a non-multi-threading environment).  See 'bsldoc_glossary' for complete
// definitions of *thread-aware*, *fully thread-safe*, and *thread-enabled*.
//
//
//          // ARB: This usage example is entirely broken, because it relies on
//          // absolute paths that no longer exist.  The example should be
//          // rephrased to work on an array of strings instead of a file, or
//          // perhaps re-written entirely.
//
///Usage
///-----
// This section illustrates intended use of this component.
//
///Example 1: A Word Search Application
/// - - - - - - - - - - - - - - - - - -
// This example illustrates the use of a 'bdlmt::MultiQueueThreadPool' in a
// word search application called 'fastSearch'.  'fastSearch' searches a list<commit_msg>Adjust warning comment in multiqueuethreadpool<commit_after>// bdlmt_multiqueuethreadpool.h                                       -*-C++-*-

// ----------------------------------------------------------------------------
//                                   NOTICE
//
// This component is not up to date with current BDE coding standards, and
// should not be used as an example for new development.
// ----------------------------------------------------------------------------

#ifndef INCLUDED_BDLMT_MULTIQUEUETHREADPOOL
#define INCLUDED_BDLMT_MULTIQUEUETHREADPOOL

#ifndef INCLUDED_BSLS_IDENT
#include <bsls_ident.h>
#endif
BSLS_IDENT("$Id: $")

//@PURPOSE: Provide a pool of queues, each processed serially by a thread pool.
//
//@CLASSES:
// bdlmt::MultiQueueThreadPool: multi-threaded, serial processing of queues
//
//@SEE_ALSO: bdlmt_threadpool
//
//@DESCRIPTION: This component defines a dynamic, configurable pool of queues,
// each of which is processed by a thread in a thread pool, such that elements
// on a given queue are processed serially, regardless of which thread is
// processing the queue at a given time.
//
// A 'bdlmt::MultiQueueThreadPool' allows clients to create and delete queues,
// and to enqueue "jobs" (represented as client-specified functors) to specific
// queues.  Queue processing is implemented on top of a 'bdlmt::ThreadPool' by
// enqueuing a per-queue functor to the thread pool.  Each functor dequeues
// the next item from its associated queue, processes it, and re-enqueues
// itself to the thread pool.  Since there is only one representative functor
// per queue, each queue is guaranteed to be processed serially by the thread
// pool.
//
// In addition to the ability to create and delete queues, clients are able to
// tune the underlying thread pool in accordance with the 'bdlmt::ThreadPool'
// documentation.
//
///Thread Safety
///-------------
// The 'bdlmt::MultiQueueThreadPool' class is *thread-aware*, but not *fully
// thread-safe*.  The function-level documentation identifies methods (i.e.,
// the 'reset' method) that cannot be safely used by multiple threads.  This
// class is also *thread-enabled* (i.e., the class does not function correctly
// in a non-multi-threading environment).  See 'bsldoc_glossary' for complete
// definitions of *thread-aware*, *fully thread-safe*, and *thread-enabled*.
//
///Usage
///-----
// This section illustrates intended use of this component.
//
// NOTICE: This usage example relies on absolute paths that may not exist.
// The example should be rephrased to work on an array of strings instead of a
// file, or perhaps re-written entirely.
//
///Example 1: A Word Search Application
/// - - - - - - - - - - - - - - - - - -
// This example illustrates the use of a 'bdlmt::MultiQueueThreadPool' in a
// word search application called 'fastSearch'.  'fastSearch' searches a list
{'fraction_non_alphanumeric': 0.15354195323246217, 'fraction_numerical': 0.000343878954607978, 'mean_word_length': 2.431858407079646, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '404815', 'n_tokens_mistral': 1562, 'n_tokens_neox': 1525, 'n_words': 664}