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

sender/receiver model 是如何玩? #66

Open
BalLooN1874 opened this issue Jun 6, 2023 · 3 comments
Open

sender/receiver model 是如何玩? #66

BalLooN1874 opened this issue Jun 6, 2023 · 3 comments

Comments

@BalLooN1874
Copy link

"由于内置动态内存分配,基于协程的异步框架可能不是性能的最优解,如果你正处于类似 30ns 延迟的极端性能场景,且不在乎编程复杂度,推荐关注 sender/receiver model,而无需尝试协程”, 老师,我目前的场景就是极致的最求性能,那么这个 sender/receiver model应该是怎么玩呢?有没有对应的事例呢。谢谢

@Codesire-Deng
Copy link
Owner

sender/receiver model 对于 C++ 来说仍然比较超前,在加入标准的路上遇到了一些阻碍。 最好的参考库可能是 libunifex。 中文的科普可以看看 这个系列

@BalLooN1874
Copy link
Author

我现在的业务场景是使用在工业现场的环境下,对于数据传输稳定性非常的敏感,数据的交互频次也会非常的高,对于数据包交互的延迟时间也非常敏感,说到底就是尽一切可能的快、稳。 最近在针对目前我们新开发的项目进行相关的技术选型。所以还想问问老师,到目前为止,[co_context]库是有用在什么具体项目中或者具体的业务场景下吗?谢谢

@Codesire-Deng
Copy link
Owner

Codesire-Deng commented Jun 6, 2023

co_context 也是一个实验性质的项目,一方面我们有许多 benchmark 数据优于其他以性能著称的框架,证实了协程和 io_uring 的性能;另一方面我们在探索更好的协程编程范式。

如果你对可靠性非常敏感,建议先测试一些使用量大的异步框架,例如 Boost.Asio,看看其性能是否满足要求。如果需要更高的性能,就需要看你的指标和可接受成本了。

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

2 participants