[Python-ideas] non-blocking buffered I/O

Steve Dower Steve.Dower at microsoft.com
Tue Oct 30 17:32:19 CET 2012


Greg Ewing wrote:
> Steve Dower wrote:
>
>> From my point of view, IOCP fits in very well provided the callbacks 
>> (which will run in the IOCP thread pool) are only used to unblock tasks.
>
> Is it really necessary to have a separate thread just to handle unblocking tasks?
> That thread will have very little to do, so it could just as well run the tasks too,
> couldn't it?

In the C10k problem (which seems to keep coming up as our "goal") that thread will have a lot to do.

I would expect that most actual users of this API could keep running on that thread without issue, but since it is OS managed and belongs to a pool, the chances of deadlocking are much higher than on a 'real' CPU thread. Limiting its work to unblocking at least prevents the end developer from having to worry about this.

Cheers,
Steve
 



More information about the Python-ideas mailing list