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

函数顺序执行的问题,只能通过线程同步来解决吗

  •  
  •   u2gign · 2019-10-24 17:52:02 +08:00 · 2320 次点击
    这是一个创建于 1617 天前的主题,其中的信息可能已经有所发展或是发生改变。
    例如顺序执行两个函数 A,B 需要等 A 执行完成后才会执行 B,是否只能通过线程同步来解决,有其他简便的方法吗
    4 条回复    2019-10-24 19:23:38 +08:00
    macha
        1
    macha  
       2019-10-24 17:57:19 +08:00
    多个线程分别执行 A 和 B?
    ClericPy
        2
    ClericPy  
       2019-10-24 17:58:25 +08:00
    使用队列, 使用 Future, 使用 callback, 使用协程
    reus
        3
    reus  
       2019-10-24 18:46:07 +08:00
    没有
    phantomzz
        4
    phantomzz  
       2019-10-24 19:23:38 +08:00
    事件驱动了解一下,回调了解一下。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1126 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 18:47 · PVG 02:47 · LAX 11:47 · JFK 14:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.