3 ms·
PHP’s fibers seem to be purely asymmetric - they provide only `resume(fiber)` and `suspend()` functions. Lua’s coroutines are similar. OTOH Ruby’s fibers also
by pansa2 5y ago
PHP’s fibers seem to be purely asymmetric - they provide only `resume(fiber)` and `suspend()` functions. Lua’s coroutines are similar.
OTOH Ruby’s fibers also provide a symmetric `transfer(fiber)` function. Asymmetric and symmetric coroutines are equivalent, so presumably Ruby implements one in terms of the other - it would be interesting to find out exactly how that was done.