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
macOS 平台 动态库hook不生效 #238
Comments
@shuai132 |
不是的,您可以试试,也许是curl内部实现并不是只简单调用的read/write。 |
程序启动时可以加 |
顺便加上 |
这应该不是协程库的问题,猜测是curl_easy_perform的机制问题(比如有锁),我简单看了下curl的源码,还没能验证猜测。 |
我还没能看明白curl里的设计。
|
|
只有一个协程操作自己的client~ 每个协程单独的 |
贴下代码看看 |
就是您的例子(简单改了几行):
|
co_sched_num = 1,就是个单线程的东西,是不可能有并发的,只能串行,但一个协程的请求不会阻塞另外协程 |
我理解您说的,我所描述的是: 或者简单来说: |
理论上不会出现这种阻塞其他协程的问题,除非有 bug,我调试一下看看 |
嗯呐 感谢,那咱们应该想的一样啦~ |
你在我们的微信群里吗? |
木有,群号多少? |
你给我发封邮件 |
OK |
已经回复邮件了 |
找到原因: |
dlsym 那套 hook 机制在 mac 上不起作用,换成 fishhook,并修复 hook select 的 bug后,在 mac 上已经能正常运行了 |
目前的
http::Client
使用curl_easy_perform
,这是一个阻塞接口。使用单个协程调度器时,http请求将阻塞其他协程。
http::Client
应该设计成非阻塞协程的,这才能体现协程的优势。推广到其他API,作为协程库里的实现,应当都设计为非阻塞的~PS:
curl_multi_perform
+辅助线程/协程(也许),或者有更好的办法(基于curl)?The text was updated successfully, but these errors were encountered: