

So You Want Your Code to Be Asynchonous? A Twisted Interview - edw519
http://oubiwann.blogspot.com/2008/06/so-you-want-your-code-to-be-asynchonous.html

======
tienshiao
Err.. seemed kind of odd to throw out "unit conversion" as an example to
discuss.

Async programming is basically about doing other things when you would have
been waiting for the result with a largely idle CPU (when you would otherwise
be blocking).

In the context of a single program or Twisted, the blocking times would be
primarily related to I/O.. the machine on the other end of the network
connection, or potentially your storage system. Using an example of "unit
conversion" that is largely assumed to be CPU bound is a poor choice since the
blocking code does not leave you with free CPU.

In the context of CPU bound problems and larger system, like a render farm or
image processing done by picture hosting sites, async programming is about
farming out work to other workers without waiting for the prior worker to
return. You could use Twisted implement it, but the situation is orthogonal to
the first situation.

------
tptacek
What a strange introduction to Twisted.

Ruby's equivalent is EventMachine. I like it better than Twisted, but mostly
because Ruby's block syntax dovetails really nicely with callback-driven state
machines.

Both Twisted and EventMachine are screaming fast.

~~~
mleonhard
... and ugly to anyone who's worked with Erlang.

~~~
tptacek
Ah, Erlang. The Ron Paul of programming languages.

