轻量级、便携式 C++纤维,麻省理工学院许可证

发布于 2024-08-02 10:48:49 字数 150 浏览 8 评论 0原文

我想获得一个具有 MIT 许可证(或更宽松)的轻量级、便携式光纤库。 Boost.Coroutine 不符合资格(不是轻量级),Portable Coroutine Library 和 Kent C++CSP(均为 GPL)也不符合资格。

编辑:你能帮我找一个吗? :)

I would like to get ahold of a lightweight, portable fiber lib with MIT license (or looser). Boost.Coroutine does not qualify (not lightweight), neither do Portable Coroutine Library nor Kent C++CSP (both GPL).

Edit: could you help me find one? :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

带刺的爱情 2024-08-09 10:48:49
  1. Libtask:MIT 许可证
  2. Libconcurrency:LGPL(比 MIT 更严格,但它是一个功能库!)

两者都是为 C 编写的。

  1. Libtask: MIT License
  2. Libconcurrency: LGPL (a little tighter than MIT, but it's a functional library!)

Both are written for C.

多彩岁月 2024-08-09 10:48:49

实际上,我过去博客对此进行了讨论。看看吧!我希望它能回答您的问题。在其中,我介绍了许多库,并且我对那些对系统编程(异步 IO)有用的库特别感兴趣。

该报道中明显缺少 Boost.Coroutine,我将在这里讨论它。 Boost.Coroutine 在概念上可能被认为是“重量级”(就其类型系列而言),但实现非常高效。真正的问题是 Boost.Coroutine 不完整,并且(我上次检查)远未完成。我花了一些时间尝试与作者合作解决其非启动问题,因为我真的很期待将它与 Boost.Asio 结合使用(这是 Boost.Coroutine 的主要目标之一),但作者还没有有时间将他的工作带到 Boost 正式审查阶段。

I actually blogged about this in the past. Have a look! I hope it answers your questions. In it, I cover a number of libraries, and I was particularly interested in ones that were useful for systems programming (asynchronous IO).

Conspicuously absent from that coverage is Boost.Coroutine, which I'll discuss here. Boost.Coroutine may be considered "heavyweight" conceptually (in terms of its family of types), but the implementation is quite efficient. The real problem is that Boost.Coroutine is incomplete, and (last I checked) far from complete. I had spent some time trying to work with the author through its non-starter issues, as I was really looking forward to using it in conjunction with Boost.Asio (this was one of Boost.Coroutine's primary objectives), but the author has not had the time to take his work to the Boost formal review stage.

删除会话 2024-08-09 10:48:49

超轻量级“线程”的 C 实现列表

请查看 Protothreads,网址为维基百科文章的底部。

list of implementations for C

for ultra lightweight "threads" take a look at Protothreads at the bottom of the wikipedia article.

娇妻 2024-08-09 10:48:49

如果 Boost 看起来很重,有帮助的人已经提取了 Boost 的相关部分 (fcontext) 作为独立库,例如 deboost.context

If Boost seems to heavy, helpful people have extracted the relevant parts of Boost (fcontext) as a standalone library, e.g. deboost.context.

绿光 2024-08-09 10:48:49

现在,您有两个更好的 Boost 许可证选项:

Now you have two better options with Boost license:

尾戒 2024-08-09 10:48:49

有一个快速且轻量级的 C 非对称协程库 - libaco

它非常小、速度非常快并且内存效率极高:

随着生产就绪的 C 协程的实现
库,这里有关于如何实现的详细文档
最快且正确的协程库,并且还具有严格的
数学证明;

它的 LOC 不超过 700 个,但具有完整的
您可能需要从协程库中获取的函数;

基准部分
表明协程之间的上下文切换仅一次
在 AWS 上大约需要 10 ns(对于独立堆栈的情况)
c5d.大型机;

用户可以选择创建一个新的协程
独立堆栈或共享堆栈(可以与其他人共享);

它的内存效率极高:10,000,000 的 co
同时运行仅花费 2.8 GB 物理内存(运行时
tcmalloc,每个co有120B的复制堆栈大小配置)。

它还具有非常详细的文档。

PS:

它遵循 Apache 许可证,版本 2.0。

There is a blazing fast and lightweight C asymmetric coroutine library - libaco.

It is really small, very fast and extremely memory efficient:

Along with the implementation of a production-ready C coroutine
library, here is a detailed documentation about how to implement a
fastest and correct coroutine library and also with a strict
mathematical proof;

It has no more than 700 LOC but has the full
function you may want from a coroutine library;

The benchmark part
shows that one time of the context switching between coroutines only
takes about 10 ns (for the case of standalone stack) on the AWS
c5d.large machine;

User could choose to create a new coroutine with a
standalone stack or with a share stack (could be shared with others);

It is extremely memory efficient: 10,000,000 amount of co
simultaneously to run only cost 2.8 GB physical memory (run with
tcmalloc, each co has a 120B copy-stack size configuration).

It also has a very detailed documentation.

PS:

It is under the Apache License, Version 2.0.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文