PHPz2017-04-17 13:06:00
There is nothing as convenient and direct to use as jstack. Generally speaking, there are several solutions:
import pudb; pudb.set_interrupt_handler()
, you can press Ctrl-C to enter the interactive debugging environment when running. The ease of use is not bad. celery
, or look at signalhandler, which comes with Python 3.3. NOTE: One disadvantage of all solutions that rely on signal is that many POSIX functions will return EINTR when these interrupts are generated, directly causing Python exceptions, such as send
, recv
, read
, write
etc. . .
巴扎黑2017-04-17 13:06:00
I don’t know Java, so I don’t know what you want. Do you want to print out the call stacks of all threads? It doesn't seem to be easy.
I am usually:
PHPz2017-04-17 13:06:00
It seems that it is not possible to use multi-threading directly in python because there is something called GIL. As for if you want to see the thread situation, you can use pdb to debug. Try it