1、说明
threading.local()实例化全局对象,该全局对象有大字典,键值为两个弱引用对象{线程对象、字典对象},通过current_thread()获取当前线程对象,并根据该对象获取相应的字典对象。
2、实例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
以上就是python thread.local()的实例化,希望对大家有所帮助。更多Python学习指路:python基础教程
1、说明
threading.local()实例化全局对象,该全局对象有大字典,键值为两个弱引用对象{线程对象、字典对象},通过current_thread()获取当前线程对象,并根据该对象获取相应的字典对象。
2、实例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
以上就是python thread.local()的实例化,希望对大家有所帮助。更多Python学习指路:python基础教程
© 2021 Python学习网 苏ICP备2021003149号-1