Skip to main content

All Questions

Tagged with
3 votes
1 answer
275 views

Lock-free, thread-safe trie container

This is a Trie data structure for mapping strings to integers or pointers in O(n) time. Based on the idea that we never delete anything from the container, we can perform concurrent read/write ...
CaptainCodeman's user avatar
4 votes
1 answer
3k views

A "zero copy" concurrent queue in C++ that supports exactly two threads; one for pushing and one for popping

One thread is limited to one action (i.e. there is a push-thread and a pop-thread and the push-thread can't pop and vice versa). By "zero copy" I mean no copying of data (mostly C++ structures) will ...
Chani's user avatar
  • 273
4 votes
1 answer
3k views

Blocking queue implementation with std::unique_ptr

I implemented, somewhat closely based on this implementation, a blocking queue with emphasis on filling up first. So if one producer and one consumer thread are using the queue, the producing queue ...
Jonas K's user avatar
  • 43
9 votes
2 answers
1k views

C++11 Blocking connection pool with auto release

Relatively new to C++. Please help me understand the potential issues with the following blocking object pool. ...
271828183's user avatar
  • 189
0 votes
1 answer
1k views

Turn a non-blocking concurrent queue into a blocking concurrent queue

Microsoft Visual Studio offers a non-blocking concurrent queue class, concurrency::concurrent_queue, based on Intel's TBB. I am using this as a base for a blocking ...
Jamerson's user avatar
  • 303
2 votes
0 answers
567 views

RCU in C++11 using std::shared_ptr and a little more

Here's some code I wrote to solve a problem at the server I'm working on. Is this valid? I've tested it, and it works, but I would like some opinions on this. It's basically a ...
Balan Narcis's user avatar
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 ...
Jonathan.'s user avatar
  • 121
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 ...
SkyWalker's user avatar
  • 141
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 ...
user avatar
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 ...
GPrathap's user avatar
  • 131
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), ...
Eóin Ó'Flynn's user avatar
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 ...
Aleksey Demakov's user avatar
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? ...
Robomatt's user avatar
  • 391
4 votes
1 answer
344 views

Parallel Reduction method with C++AMP

I am writing a C++AMP library, and as one of my utility methods I am implementing a parallel reduction algorithm based on the cascade method documented on this blog post with slight improvements by ...
Thomas Russell's user avatar
2 votes
1 answer
217 views

Assigning an array of different (but convertible) type to concurrency::array in C++AMP

I am creating a vector class which can be manipulated on the GPU and I am using C++AMP for the GPU accelerated code. I am wondering the most efficient way of assigning elements of a different type ...
Thomas Russell's user avatar

15 30 50 per page