V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Oct 26, 2020 · 2768 views
    This topic created in 2014 days ago, the information mentioned may be changed or developed.
    6 replies    2020-10-27 12:32:44 +08:00
    misaka19000
        1
    misaka19000  
       Oct 26, 2020
    估计和协程相关
    secondwtq
        2
    secondwtq  
       Oct 26, 2020 via iPhone
    全是头上带点绿的……
    matrix67
        3
    matrix67  
       Oct 26, 2020
    你这么说还真是。。。
    westoy
        4
    westoy  
       Oct 26, 2020
    就是无污染的意思

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

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

    greenlet 火了后基于这一脉的都习惯性的叫 green xxx 了
    ebingtel
        5
    ebingtel  
    OP
       Oct 27, 2020
    @westoy 搜了一下 搜出来的是 green thread……似乎是从 java 借鉴来的
    julyclyde
        6
    julyclyde  
       Oct 27, 2020
    其实就两种吧
    gevent 和 greenlet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1478 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 16:25 · PVG 00:25 · LAX 09:25 · JFK 12:25
    ♥ Do have faith in what you're doing.