Skip to content
New issue

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

请教用cpprestsdk与协程配合堵塞的问题 #185

Open
yangqun opened this issue Dec 28, 2021 · 5 comments
Open

请教用cpprestsdk与协程配合堵塞的问题 #185

yangqun opened this issue Dec 28, 2021 · 5 comments

Comments

@yangqun
Copy link

yangqun commented Dec 28, 2021

while(1){
websocket_incoming_message msg = env->client->receive().get();
....
co_cond_signal(env->cond);
poll(NULL, 0, 0);
}
请教下大神,这个阻塞导致程序一直在这里收数据,无法跳到另外的消费者协程那里去,应该怎么办呢?

@hobby
Copy link

hobby commented Dec 28, 2021 via email

@yangqun yangqun changed the title 请教打算cpprestsdk与协程配合堵塞的问题 请教用cpprestsdk与协程配合堵塞的问题 Dec 28, 2021
@yangqun
Copy link
Author

yangqun commented Dec 28, 2021

按理说hook了所有网络请求,这里应该不会阻塞了吧?有哪位同学知道吗?

@wenfh2020
Copy link

按理说hook了所有网络请求,这里应该不会阻塞了吧?有哪位同学知道吗?

什么平台,gdb 调试下,看看是否 hook 成功。协程实现函数是否调用了:co_enable_hook_sys();

@yangqun
Copy link
Author

yangqun commented Jan 7, 2022

co_enable_hook_sys这个函数在所有协程函数第一行就写了的。

@losten-cn
Copy link

co_cond_signal 这个看起来像是条件变量阻塞了,应该是没法hook的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants