V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ebingtel
V2EX  ›  Python

为啥 Python 里面这么多 green 库, 比如 greenlet、green unicorn……有啥讲究么 习惯、文化上?

  •  
  •   ebingtel · 2020-10-26 19:35:43 +08:00 · 2309 次点击
    这是一个创建于 1249 天前的主题,其中的信息可能已经有所发展或是发生改变。
    6 条回复    2020-10-27 12:32:44 +08:00
    misaka19000
        1
    misaka19000  
       2020-10-26 19:43:04 +08:00
    估计和协程相关
    secondwtq
        2
    secondwtq  
       2020-10-26 19:50:08 +08:00 via iPhone
    全是头上带点绿的……
    matrix67
        3
    matrix67  
       2020-10-26 19:58:59 +08:00
    你这么说还真是。。。
    westoy
        4
    westoy  
       2020-10-26 20:13:29 +08:00
    就是无污染的意思

    一方面,stackless -> greenlet,stackless 的用法是 cPython 打 stackless 的 patch 后重新编译, 也就是说需要动到 Python 本身, 而 port 到 py.greenlet 后就是作为一个跑在 cPython 下面的单独的包

    另一方面,green thread 对应的是原生 Pthread

    greenlet 火了后基于这一脉的都习惯性的叫 green xxx 了
    ebingtel
        5
    ebingtel  
    OP
       2020-10-27 08:50:08 +08:00
    @westoy 搜了一下 搜出来的是 green thread……似乎是从 java 借鉴来的
    julyclyde
        6
    julyclyde  
       2020-10-27 12:32:44 +08:00
    其实就两种吧
    gevent 和 greenlet
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3544 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 04:53 · PVG 12:53 · LAX 21:53 · JFK 00:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.