参考pthread,如果不是detach的,需要join(),否则会有内存泄漏。
python的threaing不join()的话会有内存泄漏吗?pydoc没提。
python的threaing不join()的话会有内存泄漏吗?pydoc没提。
|
gdqynJan 29, 2015
1
在我的实践过程中是见过有的
|
|
gdqynJan 29, 2015
2
sorry看错了,是Python啊,Python不知道,丢人了
|
|
wuhang89Jan 29, 2015
3
看具体项目,不过就python渣一般的线程也真无力吐槽了。
|
|
lazywenJan 29, 2015
4
不会内存泄露,看需求join
|
|
zerh925Jan 30, 2015
5
不一定,join()是等待线程跑完,需要回调函数就join(),否则直接start就行了。
|
|
1989922yanJan 30, 2015
6
@zerh925 看文档中,一定需要join,应该是这样的
|
|
7
@1989922yan 文档里没说“一定”
Other threads can call a thread’s join() method. This blocks the calling thread until the thread whose join() method is called is terminated. ‘can’ |
|
inevermoreJan 31, 2015
8
Python的线程没有detach选项,
我记得是你得保证main线程一直在运行,就可以不去join |