You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typedefstructACL_FIBER_ASYNCACL_FIBER_ASYNC;
FIBER_APIACL_FIBER_ASYNC*acl_fiber_async_create(intmax_queue);
FIBER_APIintacl_fiber_async_post(ACL_FIBER_ASYNC*async, void*data); // can be use in other threadFIBER_APIintacl_fiber_async_wait(ACL_FIBER_ASYNC*async, void**data, inttimeout);
FIBER_APIintacl_fiber_async_free(ACL_FIBER_ASYNC*async);
功能需求
在任意一个线程(包括fiber所在线程)可以向任意EVENT投递一个void*
被投递的EVENT有fiber在等待数据, 同时支持超时机制
最好做到. 有序投递, 有序处理 (不考虑多线程并发投递, 1:1)
投递之后可以有一个队列暂存, 若队列满了可以考虑丢弃 (并输出日志)
接口示意
详细描述
目前的多线程通讯是基于socket, 实现方式比较通用, 但个人感觉有些过重了, 也会增加listen socket
最好是利用OS提供的进程内IPC机制
查阅资料和参考libuv之后的实现思路:
而select和kqueue不了解, 或许可以先用socket pair?
也考虑过匿名pipe实现, 但细节尚未考虑周全
参考资料
https://man7.org/linux/man-pages/man2/eventfd.2.html
https://docs.microsoft.com/en-us/windows/win32/fileio/i-o-completion-ports
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-postmessagea
The text was updated successfully, but these errors were encountered: