All Questions
Tagged with c++ concurrency
65
questions
3
votes
2
answers
2k
views
C++ concurrent queue and testing
I've written concurrent queue based on std::queue.
...
1
vote
2
answers
7k
views
C++ thread safe queue implementation
I'm using this class for producer-consumer setup in C++:
...
2
votes
3
answers
10k
views
Simple parallel_for_each in C++
I need to parallelise a for loop that does quite a lot of processing over thousands of items. I came up with this basic loop that seems to work quite effectively on ...
3
votes
2
answers
241
views
Concurrent for loop in C++ - follow-up
I have incorporated all the cool points made by ChrisWue in the initial iteration of this post.
Now, I am not reinventing the wheel for my concurrent queue, but use internally ...
5
votes
1
answer
743
views
Concurrent for loop in C++
(See the next iteration.)
I have this easy to use facility that maps input elements to output elements concurrently by the means of a thread pool:
concurrent.h:
...
4
votes
4
answers
5k
views
C++11 Blocking Queue learning exercise
As part of my own C++11 learning exercise I have implemented this Blocking Queue using the new C++11 thread API. One of the aspects I would like to improve is efficiency i.e. in the ...
3
votes
3
answers
584
views
SPSC Wait Free Ring Buffer for incoming messages
This is for a single producer and single consumer wait free ring buffer. The writes need to be wait free for sure. It pre-allocates messages slots and uses a claim strategy to capture a buffer for ...
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 ...
5
votes
1
answer
2k
views
Hybrid Lock Implementation
I have an algorithm that is painfully slow if I use 'pure' mutexes. That's because most of the critical sections are short and far shorter than the work to sleep a thread. However, it is also slower ...
3
votes
1
answer
369
views
Non-blocking solution to the dining philosophers
This is one of tasks, which I had to do for the recruitment process to be started in some company. Unfortunately they didn't like it so I've decided to share it here for discussion.
Philo5.h
...
3
votes
1
answer
450
views
Implementation of FastICA in multithreading approach
I am to implement a parallel version of FastICA, so I implemented the serial version of FastICA.
Now this is the architectural diagram of how it is going to parallelize. I just coded a basic ...
9
votes
1
answer
5k
views
Continuation Implementation in C++11
While playing with the concurrency features in C++11 I noticed that there wasn't any support for continuations. I wanted to develop something similar to Tasks in The Parallel Patterns Library (PPL), ...
6
votes
1
answer
1k
views
C++ concurrency library
I started a C++11 library of concurrency primitives in order to
study and compare their performance;
provide high-quality implementation of those to use in my projects.
Its main target platform is ...
1
vote
1
answer
263
views
Parallel natural merge sort
Continuing working on Natural merge sort, I have parallelized it. Requires \$\Theta(N)\$ space and runs in $$\Omega(N + \frac{N}{P}) \cap \mathcal{O}(N + \frac{N}{P}\log_2\frac{N}{P})$$ time, where \$...
34
votes
2
answers
68k
views
A multi-threaded Producer Consumer with C++11
I am trying to learn concurrent programming in C++11. I tried to write code for a classic producer consumer concurrency problem. Would you please review and make any comments about it?
...