[Python] GvR riscrive (parti di) Twisted :-o
Nicola Larosa
nico a teknico.net
Sab 21 Gen 2012 15:39:02 CET
> Glyph Lekowitz:
>> Currently I find that it's best to have a core which is written
>> in the super-explicit callback-based approach with no coroutines
>> at all, and then high-level application logic which wraps that
>> core using yield-based coroutines.
Guido Van Rossum:
> Amen. This is exactly how I have developed NDB, a client library
> for App Engine's datastore that supports both synchronous calls
> and yield-based async calls in its user-facing API. The lowest
> level is an event loop based on callbacks.
E` un commento a un post molto interessante sulla concorrenza:
The Concurrency Spectrum: from Callbacks to Coroutines to Craziness
http://glyph.twistedmatrix.com/2012/01/concurrency-spectrum-from-callbacks-to.html?showComment=1327087492761#c8089564372113995208
("Craziness" ovviamente è il preemptive multithreading. ;-) La citazione
sotto è tratta dallo stesso post.)
--
Nicola Larosa - http://www.tekNico.net/
All the way at the end of the spectrum of course you have preemptive
multithreading, where every line of code is a mind-destroying death-trap
hiding every possible concurrency peril you could imagine, and anything
could happen at any time. When you encounter a concurrency bug you have
to give up and just try to drink your sorrows away.
- Glyph Lefkowitz, January 2012
Maggiori informazioni sulla lista
Python