[Baypiggies] asynch design

Jeff Enderwick jeff.enderwick at gmail.com
Sun Feb 7 09:08:03 CET 2010

I will say it took some time for the event-based mentality to seep into my
brain. My background was more unix-y, and then I ended up at a router
company where the code was almost exclusively under the control of event
frameworks, with a run-to-completion model. Eventually, I was able to think
in the event-based way, and I have benefitted.

For me, threads/processes were more natural at first because I am human. At
home, I might pick up a box, carry it over there, wait for my wife to open
the door, then put the box down. I naturally think in terms of serial
actions performed by my body, and this thought process carries over when I
am thinking about what a program should do. But, IMO, it is not the best
model for  most programming.

In your program you have state and events. When you have a programming
architecture that specified "there are N threads that do <some sort of
functionality>" or "this thread does <something>", you are creating
constrictions that aren't a natural/necessary part of the problem that the
program is solving.


On Thu, Feb 4, 2010 at 2:27 PM, Aahz <aahz at pythoncraft.com> wrote:

> On Wed, Feb 03, 2010, K. Richard Pixley wrote:
> >
> > I'll add that threads are generally less portable, much harder to debug,
> > (debuggers never work quite right), much harder to test, (those silly
> > nondeterminisms!), and that it's just as easy to architect an event
> > framework around asynchronous I/O which is just as intuitive as a
> > threaded model.  (I'm doing this now for a python project).
> Beware of trying to define what is "intuitive" for anyone other than
> yourself.  I've tried to wrap my head around event frameworks and I find
> it way more difficult than threads, particularly if you design threads
> around a message-passing architecture.
> --
> Aahz (aahz at pythoncraft.com)           <*>
> http://www.pythoncraft.com/
> import antigravity
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20100207/7779b732/attachment.htm>

More information about the Baypiggies mailing list