golessPython 并发编程库
使用 goless 库,你可以用 Python 语言编写 Go 语言风格的并发程序。goless 提供了 channels、select 和 gooutines 的函数,允许你使用 Go 语言漂亮和优雅的并发编程模型,但是以你习惯的 Python 方式。goless 基于 gevent、PyPy 或者 Stackless Python 构建,可用于 PyPy、CPython 和 Stackless Python 解释器,支持 Python 2.6 到 3.4
示例代码:
""" A really simple example to use when demonstrating goless. """ from __future__ import print_function import goless def simple(): channel = goless.chan() def goroutine(): while True: value = channel.recv() channel.send(value ** 2) goless.go(goroutine) for i in range(2, 5): channel.send(i) squared = channel.recv() print('%s squared is %s' % (i, squared)) # Output: # 2 squared is 4 # 3 squared is 9 # 4 squared is 16 if __name__ == '__main__': simple()
评论
TheronC++并发编程库
Theron是一个轻量级的C++并发编程库,其实现了Actor模式,利用Theron可以轻松地实现并发编程。Theron的API清晰简洁,而且支持*NIX、windows、ARM、MAC等多种平台,且
TheronC++并发编程库
0
LibdillC 语言并发编程库
Libdill是一个C开发库,可以轻松用来编写结构化的并发程序。下面例子启动两个并发的worker函数打印Hello和World:#include <libdill.h>#include
LibdillC 语言并发编程库
0
ZIOScala 异步并发编程库
ZIO是一个零依赖的Scala库,用于异步并发编程。主要特性:高性能.比Scala的Future的性能高100倍以上类型安全.使用强大的Scala编译器在编译时捕获Bug并发.可轻松构建并发应用,没有
ZIOScala 异步并发编程库
0