Dailydave mailing list archives

Re: Asynchronous


From: Meta <0xmeta () gmail com>
Date: Wed, 5 Oct 2011 22:07:08 -0700

I too fell down the asynchronous rabbit hole where, along the way, I
discovered coroutines. Although somewhat archaic, they have been around a
long time and seem to me considerably easier to read and debug. If you are
interested in exploring a somewhat different approach you are more than
welcome to check out the Python library I wrote to learn about them. The
code is still very beta but hopefully easy to use.

http://rootfoo.org/blackmamba

--meta

On Wed, Oct 5, 2011 at 6:42 PM, Isaac Dawson <isaac.dawson () gmail com> wrote:

I find Twisted python (http://www.twistedmatrix.com) very easy to debug
once you understand how Deferred work. Especially if you're using their unit
test framework Trial. I will definitely agree you that you end up spending a
lot of time porting non-async code into your async stuff, to the point where
you become kind of obsessed with it. With twisted you're feeder Queue
example is as simple as deferToThread() and then praying you don't have any
locking problems :D.

On Thu, Oct 6, 2011 at 1:38 AM, Dave Aitel <dave () immunityinc com> wrote:

 So while I'm in the process of running a large asynchronous event-driven
product in a VM in another window, it's a good time to read all sorts of
things about asynchronous programming.

Frankly, I'm not a huge fan of it, but Chris is, and he's a better
programmer than me, so we'll leave it at that. Largely, I think people are
fans of Async because most languages and kernels are terrible at threads.
Python, for example, does not have threads. "No worky worky", as we say
around here.

The downside of async is that it is basically impossible to debug, and you
need a programmer as good as Chris to even begin to use it well. Likewise,
the locking/blocking problems don't go away, they just get mapped into a
more inscrutable form.

So for systems that have working threads, you use them for anything
IO-heavy (aka, web servers/crawlers/other useful hacking tools). But since
almost no system HAS working, scalable, threads, people get excited about
async.  And then you spend your whole life saying "Hey, this thing I do
sometimes has to do a lot of work on the CPU, so let's put it in another
thread please". Or "Hey, this whole giant DB library we have to use isn't
built from the ground up to use Async, so we need it to be in its own thread
and manage a feeder Queue to it".

And then eventually you're like "Why on earth am I spending so much time
worrying about how efficient an algorithm that runs on one machine is?" and
you go off and build something that scales horizontally onto multiple
machines. (Where "multiple" is > 100).

But in the meantime you have things like asyncore and Node.js and stuff. I
can't do them justice, but these posts below are the funniest thing you'll
read since Steve Yegge <http://steve-yegge.blogspot.com/>.

http://teddziuba.com/2011/10/node-js-is-cancer.html
http://teddziuba.com/2011/10/straight-talk-on-event-loops.html
http://www.unlimitednovelty.com/2011/10/nodejs-has-jumped-shark.html

-dave

--
INFILTRATE 2012 January 12th-13th in Miami - the world's best offensive information security 
conference.www.infiltratecon.com


_______________________________________________
Dailydave mailing list
Dailydave () lists immunityinc com
https://lists.immunityinc.com/mailman/listinfo/dailydave



_______________________________________________
Dailydave mailing list
Dailydave () lists immunityinc com
https://lists.immunityinc.com/mailman/listinfo/dailydave


_______________________________________________
Dailydave mailing list
Dailydave () lists immunityinc com
https://lists.immunityinc.com/mailman/listinfo/dailydave

Current thread: