Skip to main content

All Questions

2 votes
1 answer
132 views

Thread Pool Class

I have a thread_pool class, that mimics std::thread. (I would have liked std to have a pool, but alas that is not the case.) thread_pool.h ...
rioki's user avatar
  • 462
2 votes
1 answer
2k views

C++20 Multi-queue Thread Pool with Work Stealing

This is a follow up to my previous post which also follows up on my first post regarding my thread pool implementation. I have since made some further changes and attempted to improve performance with ...
Developer Paul's user avatar
5 votes
2 answers
2k views

C++20 Single Queue Thread Pool

This is a follow up to my previous post. I've made a number of improvements to the thread pool and corrected some bugs as well. The most up to date version of the code is available on my Github. I ...
Developer Paul's user avatar
7 votes
3 answers
1k views

Lock-free multi-producer / multi-consumer queue in C++

I've been working on a lockless multi-producer, multi-consumer queue in an effort to learn as much as I can about concurrency, without the use of mutual exclusion. The queue uses a bounded ring buffer ...
Primrose's user avatar
5 votes
2 answers
4k views

C++20 Thread Pool

I've implemented a thread pool using C++20. I'm fairly new to concurrently/multi-threaded programming and wanted to work on a project that I could learn from while also getting to know some of the new ...
Developer Paul's user avatar
8 votes
0 answers
404 views

Implementing GSL synchronized_value

Core Guidelines mention a type synchronized_value<T>, which supposedly pairs std::mutex with the internal value. I couldn'...
Sergey Kolesnik's user avatar
4 votes
1 answer
289 views

Determine concurrent access to a function

Someone asked here how to determine a function is being called from multiple threads. My take on this is that they are asking about concurrent access not sequential access. The accepted answer ...
j b's user avatar
  • 141
1 vote
0 answers
772 views

A semaphore implmentation with Peterson's N process algorithm

I need feedback on my code for following statement, am I on right path? Problem statement: Implement a semaphore class that has a private int and three public methods: init, wait and signal. The ...
June's user avatar
  • 11
7 votes
2 answers
5k views

Queue for distributing tasks between threads

I implemented the following class to dispatch std::function<void(void)> objects to a thread pool. Multiple threads will block on the pop call until a task is ...
Richard's user avatar
  • 193