@
CloveAndCurrant 哈哈,给你机会了。既然你不会我就帮你个忙。
Wiki 中很明确的提到了 stackful 和 stackless:
https://en.wikipedia.org/wiki/Coroutine#Definition_and_types> Besides that, a coroutine implementation has 3 features:
> - ...
> - ...
> - whether a coroutine is able to suspend its execution from within nested function calls. Such a coroutine is a stackful coroutine. One to the contrary is called stackless coroutines, where unless marked as coroutine, a regular function can't use the keyword yield.
同时也举例了:
https://en.wikipedia.org/wiki/Coroutine#Lua> Lua has supported first-class stackful asymmetric coroutines since version 5.0 (2003), in the standard library coroutine.
很明显,有栈协程和无栈协程都是协程,不是加个定语就可以随便用的。Wiki 也不是连个有栈无栈都不懂的“过时”信息。
同一页面也明确指出了:
https://en.wikipedia.org/wiki/Coroutine#Go> However, goroutines are not coroutines (for instance, local data does not persist between successive calls).
goroutines 不是协程,加再多定语也没用。
这个总结不是给 @
CloveAndCurrant 这种人看的,他除了嘴硬啥也不懂。但我相信其他人看了自然能明辨是非。
我不相信 @
CloveAndCurrant 能再给出任何有意义的回复了。不和他聊了。