We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
例如: void fun(void *) { co_create(&co, null, fun, null); co_resume(co); }
int main(int argc, char** argvs) { stCoroutinue* co; co_create(&co, null, fun, null); co_resume(co); }
The text was updated successfully, but these errors were encountered:
按标题看不会怎么样,协程可以创建并co_resume另一个协程。 然而给的例子是递归的,会栈溢出而core dumped。 libco是非对称协程,因此你在协程A里面co_resume协程B,就相当于协程A调用协程B,libco会用一个CallStack保存这样调用关系。 这个CallStack长度是只有128,这段代码的fun大概嵌套126次就会core dumped(每个线程首次创建协程都会初始化一个main协程,并且总是在CallStack的栈底)。
Sorry, something went wrong.
与普通的递归调用一样的结果:栈溢出
No branches or pull requests
例如:
void fun(void *)
{
co_create(&co, null, fun, null);
co_resume(co);
}
int main(int argc, char** argvs)
{
stCoroutinue* co;
co_create(&co, null, fun, null);
co_resume(co);
}
The text was updated successfully, but these errors were encountered: