[Python-ideas] Async API

Nick Coghlan ncoghlan at gmail.com
Sat Oct 27 06:54:45 CEST 2012


On Sat, Oct 27, 2012 at 1:06 PM, Daniel Foerster <pydsigner at gmail.com> wrote:
> So, are threads still an option? I feel that many of these problems with
> generators could be solved with threads.

No, because available operating systems can handle a few orders of
magnitude more concurrent IO operations per process than they can
handle threads per process. The idea of asynchronous programming is to
only use additional threads when you really need them (i.e. for
blocking synchronous operations with no asynchronous equivalent), thus
providing support for a far greater number of concurrent operations
per process than if you rely entirely on threads for concurrency.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list