新版本的 PyPy 附带集成的 Stackless。
据我所知,捆绑的 Stackless 与 2001 年的原始 Stackless 不同,并有延续。所以主要是带有调度程序的绿色线程框架。
Greenlet 是 Stackless 的衍生版本,它提供 Stackless 绿色线程功能作为扩展模块。
使用PyPy中的“原生”Stackless比PyPy + greenlet +一些调度程序(例如:gevent )? 或者问题是我不能在 PyPy 中使用这些类型的扩展?更具体地说:我知道 PyPy 有自己的 greenlet 实现(基于 Continue)。但我很好奇将外部 greenlet 与 gevent 以及 PyPy 中的内部 greenlet 链接起来的可能性。
PyPy 是否附带了用于 Stackless 的异步 IO 库,而不是标准库?
我知道 Stackless 本身以及 Python 的其他异步轻线程扩展(eventlet、gevent、twisted...)。所以我不是在寻找它们之间的差异,而是在寻找来自 pypy 和 stackless 构建的优点。
New version of PyPy ships with integrated Stackless.
As far as I know the bundled Stackless is not the same as the origin Stackless from 2001 with continuations. So mainly it is the green threads framework with dispatcher.
Greenlet is a spin-of Stackless which provides the Stackless green threads functionality as an extension module.
Is there any benefit from using "native" Stackless from PyPy than PyPy + greenlet + some dispatcher (eg: gevent)? Or the problem is that i can't use those types of extensions with PyPy? To be more specific: I know that PyPy has own implementation of greenlet (based on continulet). But I'm curious of the possibility of linking external greenlet with gevent and internal one in PyPy.
Does PyPy ships with an asynchronous IO library for Stackless to be used instead of standard one?
I know the stackless itself and other asynchronous light threads extensions to python (eventlet, gevent, twisted...). So i'm not looking the differences between them, rather advantages which comes form pypy with build in stackless.
发布评论
评论(1)
PyPy 是否附带了用于 Stackless 的异步 IO 库,而不是标准库?
从 PyPy 2.6.1 和 PyPy3 2.4.0 开始,您可以使用 asyncio(通过 pypi 包)取代 stackless 的异步功能。
使用 PyPy 的“原生”Stackless 比 PyPy + greenlet + 一些调度程序有什么好处
在更丰富的 Stackless API 之外(例如微线程的酸洗),它可以提高速度,因为调度程序是用 C 编写的运行时。基准测试应该使这一点显而易见或不明显。
有关 Stackless 的更多信息,请查看这篇文章什么是 Stackless?
Does PyPy ships with an asynchronous IO library for Stackless to be used instead of standard one?
As of PyPy 2.6.1 and PyPy3 2.4.0 you can use asyncio (via the pypi package) to replace the asynchronous features of stackless.
Is there any benefit from using "native" Stackless from PyPy than PyPy + greenlet + some dispatcher
Outside the richer Stackless API (e.g. pickling of micro-threads) it can be speed since the scheduler is part of the runtime written in C. Benchmarks should make this obvious or not.
For more informations on stackless, have a lookt at this article What is Stackless?