3 ms·
FWIW I'm not trying to be snarky. > I never said you should do constant switching. It's not required. I didn't see any other way to interpret your "It should
by magicalhippo 8y ago
FWIW I'm not trying to be snarky.
> I never said you should do constant switching. It's not required.
I didn't see any other way to interpret your "It should let me choose which buffer I want to use next".
Though perhaps what you meant was that you want to be able to tell the OS "yo, here's a bunch of buffers, use these to complete my reads"?
> [...] and on the other hand being open to read from any M-sized subset of 10k handles at once, which requires only M buffers.
I interpret that as saying "yo OS, I want to read 4k each from these 10k files, but only use these M 4k buffers when doing so", where M << 10k.
If a request is slow to be fulfilled won't it hog a buffer, reducing the maximum throughput of the fast requests? Why would this be a performance win?
- jstimpfle 8y ago> Though perhaps what you meant was that you want to be able to tell the OS "yo, here's a bunch of buffers, use these to complete my reads"? Thank you for clarifying, and yes, that would be the best way to do it I think. > If a request is slow to be fulfilled won't it hog a buffer, reducing the maximum throughput of the fast requests? Why would this be a performance win? So someone else here said that with IOCP the kernel doesn't have its own read buffers but writes directly to userspace memory (in cases where this is possible, anyway). So there might be a possiblity for buffer hogging, I don't know. On the other hand, when the request really is slow to be fulfilled, the OS could just call it a partial write and notify the program of a (partial) completion. In which case the buffer is free for other uses again.
- magicalhippo 8y agoThanks for the follow-up. Would be interesting to see if it made much difference in the end, guess we'll have to wait a bit longer for all of Windows to be open sourced :P