Nicola Larosa wrote:
"3. Explicit coroutines: Twisted’s @inlineCallbacks, Tulip’s yield
from coroutines, C#’s async/await, where you have a syntactic
feature that explicitly suspends the current routine,

4. and finally, implicit coroutines: Java’s “green threads”,
Twisted’s Corotwine, eventlet, gevent, where any function may
switch the entire stack of the current thread of control by calling
a function which suspends it."

Manlio Perillo wrote:
Go non ha una sintassi per sospendere esplicitamente una goroutine;
quindi appartiene a 4)?

La sospensione avviene quando una goroutine manda un valore su un canale
non bufferizzato: fin quando un'altra goroutine non legge quel valore, la
prima è bloccata.

E poi ovviamente anche quando una goroutine riceve un valore da un canale
non bufferizzato, o vuoto.

Invio e ricezione fanno parte della sintassi del linguaggio, tramite gli operatori freccia "->" e "<-".

--
Nicola Larosa - http://www.tekNico.net/

A plus sign is just a square with collapsed sides,
after passing through a hash sign:
    ◽ # +
(Where are my medications when I need them?)
 - Nicola Larosa, February 2014
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a