Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COOK, I'm stumped. If all these clients are coming to the server asking for their files, how does it matter if the request is sync or async? Ultimately the server has to connect to the client and send the data, and when the files are large (which they are) it will take a long time to send and eat a thread in the process. If the server were doing something long-running I could understand this, but really it's the client that's the slowpoke.
      singulars
    2. COExactly. In sync mode, you have one thread per client blocked on buffer reads/writes, causing the scheduler to frequently walk around and wake them, only to usually waste the timeslice hoping the buffer write will complete. Once you've got about 20-30 of those happening, it's spending more time doing thread state restores than real work. When you offload the reads/writes using kernel async primitives, IOCP uses a very lightweight scheduler and h/w interrupts to service the buffers and only assign and poke a worker thread when a buffer is ready. Many fewer threads == much more work done.
      singulars
    3. COThe important part is to use the async primitives on your reads and writes (read from FileStream opened w/ async FileOption set and implement the service as Begin/End with AsyncPattern=true), and use the Begin/EndRead and Begin/EndWrite with callbacks. Otherwise, you ARE just moving the problem around. The client can continue to call the method the "looks synchronous" way. This pattern can be kinda complex if you've never implemented it before (it's kind of a "ping-ponging callbacks" thing), but it WILL vastly increase your throughput for this kind of thing.
      singulars
 

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