基于C++ Coroutines提案 ‘Stackless Resumable Functions’编写的协程库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tearshark d854bd00f6 重写channel的实现方法 4 years ago
benchmark 将异常和返回值做成union以减小state的大小。 4 years ago
doc create repository 6 years ago
librf 重写channel的实现方法 4 years ago
tutorial 重写channel的实现方法 4 years ago
vs_proj 重写channel的实现方法 4 years ago
.gitignore 优化Modern Callback范例,使得modern_callback_adapter_t更加通用并简化使用 5 years ago
LICENSE create repository 6 years ago
README.md 重写channel的实现方法 4 years ago

README.md

librf 2.4

librf - 协程库

2020-03-08 更新:

更新channel实现,效率提高了近三倍。
channel的新的实现方法,为event/mutex指明了新的修改方向。

2020-02-16 更新:

更新调度器算法,深入应用Coroutines的特性,以期获得更高调度性能。
不再支持C++14。

librf是一个基于C++ Coroutines提案 ‘Stackless Resumable Functions’编写的非对称stackless协程库。

目前仅支持:

Windows (使用VS2017/VS2019/clang编译)
Android (使用NDK 20.1 自带的clang编译)

librf有以下特点:

  • 1.基于C++17提案’Stackless Resumable Functions’编写的非对称stackless协程库,可以以同步的方式编写简单的代码,同时获得异步的性能
  • 2.理论上支持海量协程, 创建100万个协程只需使用<430M>物理内存
  • 3.提供协程锁(mutex), 定时器, channel等特性, 帮助用户更加容易地编写程序
  • 4.可以很好的跟asio,libuv等库结合,能跟现有的callback范式的异步/延迟代码很好的结合
  • 5.目前还处于实验状态,不对今后正式的C++ Coroutines支持有任何正式的承诺

  • 如果你发现了任何bug、有好的建议、或使用上有不明之处,可以提交到issue,也可以直接联系作者: email: tearshark@163.net QQ交流群: 296561497

  • doc目录下有作者搜集的一些关于C++协程的资料

  • tutorial目录下有针对每个特性的范例代码,让用户可以循序渐进的了解librf库的特性