how are you five ... ok: the poor are poor, the asink is good!
now, seriously: threads carry overhead - both when locking, and when switching the interpreter, as well as in memory consumption and code complexity. when your program is tied to IO and waits a lot for other services (APIs, databases) to return a response, you mostly expect downtime and waste resources.
The point of asynchronous I / O is to reduce the overhead of threads while maintaining concurrency, and keeping your program simple by avoiding deadlocks and reducing complexity.
think, for example, about a chat server. you have thousands of connections on the server and you want some people to receive messages depending on which room they are in. doing this with threads will be a lot harder than doing it in an asynchronous way.
re deferred is just a way to simplify the code, instead of giving each function a callback to return when an upcoming operation is ready.
another note - if you want a much simpler and sleeker structure of asynchronous I / O, try a tornado, basically it is an asynchronous web server, with an asynchronous http client and replacing pending ones. It is very beautifully written and can be used as a universal asynchronous I / O structure.
see http://tornadoweb.org
source share