Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

New answers tagged

1 vote
Accepted

Multithreaded tcp server accepting two clients with task factory and graceful shutdown

In this post let me focus only on the TcpServer class. I will post another review about the TcpClientTwo class next week. ...
user avatar
  • 5,560
2 votes

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

Create a struct worker You have a the member variables threads_ and tasks, one is a ...
user avatar
  • 32.6k
2 votes

Multi-threaded Mandelbrot set generator slower than single thread

Distributing the work among threads D. Jurcau already mentioned that you are not distributing your work correctly. It's even worse than his terse answer hints at. One issue is that inside the lambda ...
user avatar
  • 32.6k
1 vote

Multi-threaded Mandelbrot set generator slower than single thread

You don't distribute work among your threads correctly. According to your code, only by the time a thread has completed its work is the start point for the next thread(s) updated.
user avatar
  • 2,975
0 votes

Do I really need to re-interrupt a thread doing end-of-life tasks on interruption?

There is a major bug in your code. You use the Thread.interrupt() to control the thread lifecycle but you never check ...
user avatar

Top 50 recent answers are included