Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It will shock you, but <a href="https://stackoverflow.com/a/19564538/1083704">you do not need any threads for I/O</a> (quantitatively, this means 0 threads). It is good that you have studied that multithreading does not multiply your network bandwidth. Now, it is time to know that <strong>threads do computation. They are not doing the (high-latency) communication. The communication is performed by a network adapter, which is another process</strong>, running really in parallel with with CPU. <strong>It is stupid to allocate a thread</strong> (see <a href="https://stackoverflow.com/a/19563599/1083704">which resources allocated are listed by this gentlemen who claims that you need 1 thread</a>) <strong>just to sleep until network adapter finishes its job</strong>. You need no threads for I/O = you need 0 threads. </p> <p>It makes sense to allocate the threads for computation to make in parallel with I/O request(s). The amount of threads will depend on the <a href="https://www.google.ee/search?q=communication-to-computation%20ratio" rel="nofollow noreferrer">computation-to-communication ratio</a> and <a href="https://stackoverflow.com/a/19564174/1083704">limited by the number of cores in your CPU</a>.</p> <p>Sorry, I had to say that despite you have certainly implied the commitment to blocking I/O, so many people do not understand this basic thing. Take <a href="https://stackoverflow.com/a/19564538/1083704">the advise, use asynchronous I/O</a> and you'll see that the issue does not exist.</p>
    singulars
    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.
    1. VO
      singulars
      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