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
co_routine.cpp:
static stCoRoutineEnv_t* g_arrCoEnvPerThread[ 102400 ] = { 0 };
采用数组的好处显而易见,但以pid索引这个数组很可能越界。需要该为其他数据结构。
The text was updated successfully, but these errors were encountered:
没看过代码,字面意思每个线程共享的协程数组。 引用<<单易用高性能的协程库http://mp.weixin.qq.com/s/bCWM6ncUseEDpynlBvT8hA>>文章中"我们通过libco共享栈模式创建1千万的协程(E5-2670 v3 @ 2.30GHz * 2, 128G内存),每10万个协程共享的使用128k内存,整个稳定echo服务的时候总内存消耗大概为66G。”
Sorry, something went wrong.
引用google结果:一般PID_MAX=0x8000(可改),因此进程号的最大值为0x7fff,即32767。 这里最新的版本好像已经改为204800,越界的概率基本为0。当然,这里这样写,感觉有些不太优雅。
No branches or pull requests
co_routine.cpp:
static stCoRoutineEnv_t* g_arrCoEnvPerThread[ 102400 ] = { 0 };
采用数组的好处显而易见,但以pid索引这个数组很可能越界。需要该为其他数据结构。
The text was updated successfully, but these errors were encountered: