[Python-ideas] New PEP proposal: C Micro-Threading (ala Twisted) (long!)

Antoine Pitrou solipsis at pitrou.net
Sun Aug 3 14:33:47 CEST 2008


Hi,

> P.S. After having used event-driven frameworks for quite a few years
> (asyncore derived socket servers and clients, wxPython,
> publish/subscribe architectures, ...), they really aren't all that
> bad.

Probably. Well, wxPython is quite lousy, and Twisted is very good.
However, the problem is there are lots of them, and by construction they can't
easily be mixed together (although there are various hacks to do so).

Having a standard way to define low-level asynchronicity (especially with a C
API) would allow to merge those worlds quite naturally.

Another interesting aspect of this proposal is that the core functions would be
implemented in C, which would be very interesting performance-wise, and would
also allow to write accelerators in C so that some events don't even involve
interpreting Python bytecode. The Twisted reactor overhead is prohibitive when
dealing with lots of tiny messages.

Regards

Antoine.





More information about the Python-ideas mailing list