Skip to main content

All Questions

Tagged with
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
5 votes
2 answers
461 views

Automatic RAII wrapper for concurrent access

Probably many people had to work with multithreaded applications with C++ and can understand how messy can be fine-grained locking of objects. So once in a while I came to idea of implementing some ...
gudvinr's user avatar
  • 51
8 votes
3 answers
3k views

The dumbest (futex-based) mutex

After reading Ulrich Drepper's "Futexes are Tricky", I have written the following "dumbest mutex" in C++14 using the Linux futex primitives. This mutex is simpler ...
Quuxplusone's user avatar
  • 19.4k
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
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 \$...
coderodde's user avatar
  • 28.9k