libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::ppd Namespace Reference

Parallel Pixie Dust or PPD is the name of the thread library within libjmmcg. More...

Namespaces

namespace  generic_traits
 
namespace  lock
 
namespace  no_locking
 
namespace  NTUtils
 
namespace  pool
 
namespace  pool_traits
 A namespace to hold various traits relating to selecting the specific specialisation of thread_pool they would like.
 
namespace  private_
 
namespace  pthreads
 

Classes

struct  api_lock_traits
 
struct  api_lock_traits< generic_traits::api_type::no_api, sequential_mode >
 
struct  api_lock_traits< generic_traits::api_type::posix_pthreads, heavyweight_threading >
 The various lock-types for POSIX-threads derived, platforms. More...
 
struct  api_lock_traits< generic_traits::MS_Win32, heavyweight_threading >
 
struct  api_lock_traits< platform_api, sequential_mode >
 The various lock-types for sequential use, with no threading. More...
 
struct  api_threading_traits
 
struct  api_threading_traits< generic_traits::api_type::no_api, sequential_mode >
 
class  atomic_ctr_gen
 A general-purpose, atomic counter class, similar to the atomic integer types in C++11 ch 29. More...
 
class  atomic_ctr_gen< V, api_lock_traits< API, sequential_mode > >
 A specialisation for sequential operation to optimise performance. More...
 
class  atomic_ctr_opt
 An atomic counter class for integer types, similar to the atomic integer types in C++11 ch 29. More...
 
class  basic_statistics
 Some basic statistics collected about the operation of the wrapping thread_pool. More...
 
struct  cliques
 A modifier that enables dividing the thread_pool into a number of equal-sized cliques of pool_threads. More...
 
class  control_flow_graph
 A class to generate a Control Flow Graph (CFG), if the support has been coded into the joinable, nonjoinable, etc modifiers. More...
 
class  funky_queue
 An adaptor to add thread-safety assistance, specifically for queues. More...
 
struct  jthread
 Make sure the kernel-thread is always joined in the dtor. More...
 
struct  model_traits
 
class  no_control_flow_graph
 A dummy class to not generate a Control Flow Graph (CFG), and hopefully and hopefully all calls will be optimised out, so there should be no cost. More...
 
class  no_signalling
 Atomically count the amount of work that there is to do, and provide access to the lock on the containing collection. More...
 
struct  no_statistics
 Just stub statistics - to support the interface. No actual statistics are collected. More...
 
class  noop_atomic_ctr_base
 An atomic counter class that actually does nothing, doesn't count at all. More...
 
struct  null_thread_worker_context
 A handy utility class for the "thread_wrapper" class, that is supposed to do nothing. More...
 
struct  numa_cpu_traits
 
struct  pool_aspects
 The fundamental way to specify the type of thread_pool that is required. More...
 
class  priority_queue
 A thread-safety-assisted adaptor for a priority_queue. More...
 
class  queue
 An adaptor to add thread-safety assistance, specifically for queues. More...
 
class  safe_colln
 An adaptor for a container that attempts to add some thread-safety to assist in making thread-safe programs. More...
 
class  signalling
 A flag to atomically signal if the container contains work or not and also count the amount of work that there is to do. More...
 
class  thread
 This class is used to implement a class that wraps using a thread, it is an alternative to using a thread pool to manage your threads, in a C++ std::thread-style manner. More...
 
struct  thread_os_traits
 This class is used to encapsulate the OS-specific threading traits, mutexes, etc for the "thread_pool<...>" and other classes. More...
 
class  thread_params
 
class  thread_params< generic_traits::api_type::posix_pthreads >
 Wrap up the PThreads details regarding creating a thread, so that it is normalised for the rest of the library. More...
 
class  thread_params< generic_traits::MS_Win32 >
 
class  thread_pool
 
class  thread_pool< pool_traits::work_distribution_mode_t::one_thread_distributes<>, pool_traits::size_mode_t::fixed_size, PTT >
 This pool has a limited, specified size, and uses a master to distribute the work to the worker threads. More...
 
class  thread_pool< pool_traits::work_distribution_mode_t::one_thread_distributes<>, pool_traits::size_mode_t::infinite, PTT >
 This pool has an unlimited size, and uses a master to distribute the work to the worker threads. More...
 
class  thread_pool< pool_traits::work_distribution_mode_t::one_thread_distributes<>, pool_traits::size_mode_t::sequential, P >
 This compatibility-pool has an unlimited size, and uses a master to execute the work. More...
 
class  thread_pool< pool_traits::work_distribution_mode_t::one_thread_distributes<>, pool_traits::size_mode_t::tracks_to_max, PTT >
 This pool has a maximum specified size to which it will grow and reduce from, and uses a master to distribute the work to the worker threads. More...
 
class  thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::fixed_size, PTT >
 This pool has a specified size, and the worker pool_threads steal work from a centrally-held signalled_work_queue. More...
 
class  thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::sequential, P >
 This compatibility-pool has an unlimited size, and the "worker thread"s directly execute the work. More...
 
class  thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::pool_owns_queue >, pool_traits::size_mode_t::tracks_to_max, PTT >
 This pool has a maximum specified size to which it will grow and reduce from, and the worker pool_threads steal work from a centrally-held signalled_work_queue. More...
 
class  thread_pool< pool_traits::work_distribution_mode_t::worker_threads_get_work< pool_traits::work_distribution_mode_t::queue_model_t::thread_owns_queue< pool_traits::work_distribution_mode_t::queue_model_t::stealing_mode_t::random > >, pool_traits::size_mode_t::fixed_size, PTT >
 This pool has a specified size, and the worker pool_threads steal each have a signalled_work_queue. More...
 
class  wrapper
 This class is used to implement a class that wraps using a thread, it is an alternative to using a thread pool to manage your threads. More...
 

Typedefs

using sequential_mode = model_traits< generic_traits::creation_cost::sequential_creation, generic_traits::destruction_cost::sequential_destruction, generic_traits::synchronisation_cost::sequential_sync >
 I.e. single-threaded, no locks. More...
 
using heavyweight_threading = model_traits< generic_traits::creation_cost::expensive_to_create, generic_traits::destruction_cost::expensive_to_destroy, generic_traits::synchronisation_cost::expensive_to_synchronise >
 
using lightweight_threading = model_traits< generic_traits::creation_cost::cheap_to_create, generic_traits::destruction_cost::cheap_to_destroy, generic_traits::synchronisation_cost::cheap_to_synchronise >
 E.g. x86 or SPARC. More...
 
template<class V , class LkT >
using atomic_ctr = typename std::conditional< std::is_integral< V >::value, atomic_ctr_opt< V, LkT >, typename std::conditional< std::is_pointer< V >::value, atomic_ctr_opt< V, LkT >, atomic_ctr_gen< V, LkT > >::type >::type
 A general-purpose, atomic-wrapper class, similar to the atomic types in C++11 ch 29, with some important differences. More...
 

Functions

template<generic_traits::api_type API>
tostream &__fastcall FORCE_INLINE operator<< (tostream &os, thread_params< API > const &p)
 
template<class V , class LkT >
tostream &FORCE_INLINE operator<< (tostream &os, atomic_ctr< V, LkT > const &a)
 
char const * SIG_to_string (int signal_number) noexcept(true)
 
std::ostream & operator<< (std::ostream &os, siginfo_t const &si) noexcept(true)
 
void abort_handler (int signal_number, siginfo_t *info, void *) noexcept(true)
 
void dump_bt_to_cerr ()
 

Detailed Description

Parallel Pixie Dust or PPD is the name of the thread library within libjmmcg.

Why is it called "ppd"? It stands for "Parallel Pixie Dust", a term coined at the ACCU by, if I recall correctly, Hubert Matthews in around 2001, whilst I was in conversation with him about thread libraries and their ability to shield a programmer from the issues of threading.

Typedef Documentation

◆ atomic_ctr

template<class V , class LkT >
using jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::atomic_ctr = typedef typename std::conditional< std::is_integral<V>::value, atomic_ctr_opt<V, LkT>, typename std::conditional< std::is_pointer<V>::value, atomic_ctr_opt<V, LkT>, atomic_ctr_gen<V, LkT> >::type >::type

A general-purpose, atomic-wrapper class, similar to the atomic types in C++11 ch 29, with some important differences.

Unlike std::atomic: #Works for any type: integer-types & pointers (to anything) are atomic, others use a mutex, so aren't: guaranteed. #Has a uniform interface. #Also note that this class reduces to a simple V-type, if it is single threaded, so costs nothing. #Note that this class is a valid value-type.

See also
std::stomic

Definition at line 520 of file atomic_counter.hpp.

◆ heavyweight_threading

◆ lightweight_threading

◆ sequential_mode

Function Documentation

◆ abort_handler()

void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::abort_handler ( int  signal_number,
siginfo_t *  info,
void *   
)
inlinenoexcept

Definition at line 167 of file thread_api_traits_impl.hpp.

◆ dump_bt_to_cerr()

void jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::dump_bt_to_cerr ( )
inline

Definition at line 208 of file thread_api_traits_impl.hpp.

◆ operator<<() [1/3]

std::ostream& jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::operator<< ( std::ostream &  os,
siginfo_t const &  si 
)
inlinenoexcept

Definition at line 156 of file thread_api_traits_impl.hpp.

◆ operator<<() [2/3]

template<class V , class LkT >
tostream& FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::operator<< ( tostream os,
atomic_ctr< V, LkT > const &  a 
)
inline
Todo:
Implement using the advice given in "Standard C++ IOStreams and Locales" by A.Langer & K.Kreft, page 170.

Definition at line 534 of file atomic_counter.hpp.

◆ operator<<() [3/3]

template<generic_traits::api_type API>
tostream& __fastcall FORCE_INLINE jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::operator<< ( tostream os,
thread_params< API > const &  p 
)
inline

Definition at line 249 of file thread_params_traits.hpp.

◆ SIG_to_string()

char const* jmmcg::LIBJMMCG_VER_NAMESPACE::ppd::SIG_to_string ( int  signal_number)
inlinenoexcept

Definition at line 125 of file thread_api_traits_impl.hpp.