Hacker News new | past | comments | ask | show | jobs | submit login
So You Want Your Code to Be Asynchonous? A Twisted Interview (oubiwann.blogspot.com)
8 points by edw519 on June 28, 2008 | hide | past | favorite | 4 comments



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.


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.


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


Ah, Erlang. The Ron Paul of programming languages.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: