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
ray1888
V2EX  ›  Python

线程问题

  •  
  •   ray1888 ·
    ray1888 · 2017-08-23 08:56:31 +08:00 · 1752 次点击
    这是一个创建于 2679 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想问一个问题,既然 threading 模块里面 join 的官方解释是: join([timeout]) Wait until the thread terminates. This blocks the calling thread until the thread whose join() method is called terminates – either normally or through an unhandled exception – or until the optional timeout occurs.

    When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call isAlive() after join() to decide whether a timeout happened – if the thread is still alive, the join() call timed out.

    那它是怎样去对 threading 是否 termaine 进行判断吗?还是 python 通过信号量来进行判断的,求大神解释

    2 条回复    2017-08-23 10:09:20 +08:00
    NoAnyLove
        1
    NoAnyLove  
       2017-08-23 09:30:03 +08:00
    你想要知道的答案全部在 threading.py 里面
    snnn
        2
    snnn  
       2017-08-23 10:09:20 +08:00 via Android
    最后这段中文我严重没看懂。请复述一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3379 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:34 · PVG 19:34 · LAX 03:34 · JFK 06:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.