推荐学习书目
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
shyrock
V2EX  ›  Python

pycharm 下断点调试代码,总是被另外的线程乱入导致运行栈切换,该怎么办??

  •  
  •   shyrock · Dec 29, 2018 · 1753 views
    This topic created in 2712 days ago, the information mentioned may be changed or developed.
    断点的 suspend 设为 Thread 和 All 貌似都遇到这个问题。。。

    为防止有人看不明白。假设我开了两个 http worker 来处理前端请求,
    处理函数
    def proc_request(self):
    x=x+1 <====下断点

    开始调试时,运行栈有两个:
    http worker1 <====我跟踪的这个
    http worker2

    调试大约几十秒之后,突然又跳到了上面这个断点,且运行栈切换:
    http worker2 <====当前激活的,但不是我想调试的
    http worker1 <====未中断,无法看到栈页信息
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5584 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 93c8b4a0 · 31ms · UTC 07:50 · PVG 15:50 · LAX 00:50 · JFK 03:50
    ♥ Do have faith in what you're doing.