3 ms·
A helpful hint on the name: Yield should be read like "Yields" as in "returns" or "produces". Not Yield as in the common multithreading command to allow anothe
by ars 14y ago
A helpful hint on the name: Yield should be read like "Yields" as in "returns" or "produces".
Not Yield as in the common multithreading command to allow another thread to run.
PS. Anyone know why they chose such a confusing name?
- Someone 14y agoBecause it allows another thread to run. Yes, they actually are coroutines, but that is an implementation detail. Just look at it as an optimization for the case where at most one of the two threads (the one producing the values and the one consuming it) runs at a time.