Skip to content

Conversation

@yueshuaijie
Copy link

我用到的一个c库除了网络IO block,还有sleep()等其他block,所以我fork了greenify来实现非阻塞的sleep。原理是把常用的sleep()函数替换为timerfd,加入事件循环,监听read()。
(未解决信号中断sleep的问题)

用法:patch_lib()增加了个默认参数:patch_sleep=False,默认不patch sleep()
如需patch:
greenify.patch_lib('/usr/lib/libmemcached.so', patch_sleep=True)

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

Successfully merging this pull request may close these issues.

1 participant