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
BUG: 协程栈上数据的地址传递给其他协程处理时,可能出现错误。 边界条件:协程无法独占共享栈时(co_stack_num满)。
TestCase:
#include "co/co.h" int main(int argc, char **argv) { flag::init(argc, argv); FLG_cout = true; flag::set_value("co_sched_num", "1"); flag::set_value("co_stack_num", "1"); // flag::set_value("co_sched_log", "true"); go([&] { char buf[] = "test"; LOG << "buf:1: " << buf; go([&] { LOG << "buf:2.1: " << buf; // error here: expect `text` buf[0] = 'T'; LOG << "buf:2.2: " << buf; // error here: expect `Text` co::sleep(1); }); co::sleep(1); LOG << "buf:3: " << buf; // error here: expect `Text` co::sleep(1); }); co::sleep(10); return 0; }
说明: 协程栈有多种实现方式,我还是更倾向于优先保证C++常见写法的正确性。 目前共享栈的方式容易出现上述问题,需要使用者避免此类写法。
我们是否可以考虑改为虚拟内存自动扩容的协程栈方式? @idealvin
The text was updated successfully, but these errors were encountered:
64位系统可以考虑每个协程单独分配一个1M的栈
Sorry, something went wrong.
No branches or pull requests
BUG:
协程栈上数据的地址传递给其他协程处理时,可能出现错误。
边界条件:协程无法独占共享栈时(co_stack_num满)。
TestCase:
说明:
协程栈有多种实现方式,我还是更倾向于优先保证C++常见写法的正确性。
目前共享栈的方式容易出现上述问题,需要使用者避免此类写法。
我们是否可以考虑改为虚拟内存自动扩容的协程栈方式? @idealvin
The text was updated successfully, but these errors were encountered: