Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68246

Re: which async framework?

References (1 earlier) <1733040935416225908.878896sturla.molden-gmail.com@news.gmane.org> <loom.20140311T170030-477@post.gmane.org> <372076480416251284.821607sturla.molden-gmail.com@news.gmane.org> <mailman.8056.1394563452.18130.python-list@python.org> <877g80nzdx.fsf@elektro.pacujo.net>
Date 2014-03-12 09:38 +1100
Subject Re: which async framework?
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.8064.1394577523.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Mar 12, 2014 at 9:28 AM, Marko Rauhamaa <marko@pacujo.net> wrote:
> If you can't write your own event loop, you probably can't be trusted
> with any multithreaded code, which has much more baffling corner cases.

I'm not sure about that. Threads are generally easier to handle,
because each one just does something on its own, sequentially. (The
problem with threads is the resource usage - you need to allocate X
amount of stack space and other execution state, when all you really
need is the socket (or whatever) and some basic state about that.)
Regardless of how you structure your code, you have to ensure that one
handler doesn't tread on another's toes, and with multithreading,
that's _all_ you have to worry about. A proper event loop, handling
events from all sorts of different sources, is far more complicated.

What corner cases are there with threads that you don't have with anything else?

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: which async framework? Antoine Pitrou <solipsis@pitrou.net> - 2014-03-11 18:43 +0000
  Re: which async framework? Marko Rauhamaa <marko@pacujo.net> - 2014-03-12 00:28 +0200
    Re: which async framework? Chris Angelico <rosuav@gmail.com> - 2014-03-12 09:38 +1100
      Re: which async framework? Marko Rauhamaa <marko@pacujo.net> - 2014-03-12 01:18 +0200
        Re: which async framework? Chris Angelico <rosuav@gmail.com> - 2014-03-12 10:38 +1100
          Re: which async framework? Marko Rauhamaa <marko@pacujo.net> - 2014-03-12 02:10 +0200
        Re: which async framework? Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-12 03:58 -0600

csiph-web