代码改变世界

py.magic.greenlet: Lightweight concurrent programming

2011-10-07 22:21 by prim, 521 阅读, 0 推荐, 收藏,
摘要:原文地址:py.magic.greenlet: lightweight concurrent programming1 Motivationgreenlet算是Stackless的开发过程中的副产品。(Stackless是一个CPython版本,支持某种被称为'tasklets'微线程的;多个tasklet看起来像是并发运行的,运行在一个或几个OS级的线程中;tasklet可以使用channel同步交换数据)比起tasklets,greenlet更像是一种不带隐藏调度(就是不是你自己可以操控的调度)更为原始的微线程。你也可以称greenlet为coroutine协程。green 阅读全文