Note that there are some explanatory texts on larger screens.

plurals
  1. POIntel TBB tasks for serving network connections - good model?
    primarykey
    data
    text
    <p>I'm developing a backend for a networking product, that serves a dozen of clients (<code>N</code> = 10-100). Each connection requires 2 periodic tasks, the heartbeat, and downloading of telemetry via SSH, each at <code>H</code> Hz. There are also extra events of different kind coming from the frontend. By nature of every of the tasks, there is a solid part of waiting in <code>select</code> call on each connection's socket, which allows OS to switch between threads often to serve other clients while waiting for response. </p> <p>In my initial implementation, I create 3 threads per connection (heartbeat, telemetry, extra), each waiting on a single condition variable, which is poked every time there is something to do in a workqueue. The workqueue is filled with the above-mentioned periodic events using a timer and commands from the frontend.</p> <p>I have a few questions here.</p> <ol> <li><p>Would it be a good idea to switch a worker thread pool approach to Intel TBB tasks? If so, to which value of threads do I need to initialize <code>tbb::task_scheduler_init</code>? </p></li> <li><p>In the current approach with 300 threads waiting on a conditional variable, which is <code>signal</code>ed <code>N * H * 3</code> times per second, it is likely to become a bottleneck for scalability (especially on the side which calls <code>signal</code>). Are there any better approaches for waking up just one worker per task?</p></li> <li><p>How is waking of a worker thread implemented in TBB?</p></li> </ol> <p>Thanks for your suggestions!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload