ANN: Twisted 1.1.1
Andrew Bennetts
andrew-pythonlist at puzzling.org
Thu Dec 11 05:43:26 EST 2003
On Wed, Dec 10, 2003 at 11:11:40PM +0100, Just wrote:
>
> This ties nicely into the xsdb + stackless discussion:
>
> - threads + blocking sockets is attractive since the code can be
> written in a natural style, yet cause overhead and
> synchronization headaches.
>
> - async sockets are attractive because they avoid threads and
> therefore avoid overhead and synchronization issues. Yet it
> is often a bit harder to code, since you need to turn your
> code inside out, using callbacks.
>
> But there is a "perfect" solution: co-routines. With co-routines you can
> both write the code in a "natural" style, but still using an even-driven
> core. This is a very pleasant model to work with, so I totally
> understand that some people (eg. Aaron) choose to use Stackless to make
> this possible.
co-routines miss one of the features of the threading model, though, which
is preemptive concurrency. I prefer the async way of working too, but I can
see that co-routines don't provide the best of both worlds...
-Andrew.
More information about the Python-list
mailing list