49# ifndef Q_CONSUMER_THREADS_H
50# define Q_CONSUMER_THREADS_H
53# include <condition_variable>
143 std::unique_lock<std::mutex>
cs(
lck);
145 <<
"~QueueTheadsPool: shutdown not done";
164 auto th = std::thread(
handler,
this, event);
169 <<
"Thread creation with an event owned by another";
182 q.put(std::forward<T>(item));
258 event->item =
q.get();
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
Dynamic queue of elements of generic type T based on single linked list.
Dynamic singly linked list with functional programming support.
bool run()=0
this is a item extracted from the queue
std::atomic< Status > status
virtual ~ConsumerQueueEvent()
size_t get_count() const noexcept
virtual void run()=0
this is a item extracted from the queue
std::atomic< size_t > count
void increment_count() noexcept
Pool of consumer threads form a queue.
std::condition_variable cond
DynList< ConsumerQueueEvent * > event_list
static void handler(QueueTheadsPool< T > *threads_pool, ConsumerQueueEvent *event)
std::condition_variable shutdown_cv
void run_event(ConsumerQueueEvent *event)
void create_thread(ConsumerQueueEvent *event)
and
Check uniqueness with explicit hash + equality functors.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
std::decay_t< typename HeadC::Item_Type > T
Dynamic queue implementation based on linked lists.