Threading Module源码概述(一)
2016-01-05 21:36
281 查看
Python的Threading模块是建立在thread module基础上的一个模块,在threading模块中,暴露着许多thread模块的属性。比如threading._get_ident实际上就是thread.get_ident.
第二步
def start(self): try: #调用_start_new_thread创建子线程 _start_new_thread(self.__bootstrap, ()) def __bootstrap(self): try: self.__bootstrap_inner() def __bootstrap_inner(self): try: self._set_ident() #获得线程id self.__started.set() with _active_limbo_lock: _active[self.__ident] = self #将线程id保存到_active的dict del _limbo[self] #移除之前limbo字典中的线程
第二步
相关文章推荐
- SOA基础
- java项目中常用的分页对象Page
- AJAX个人理解
- Linux中断(interrupt)子系统之四:驱动程序接口层 & 中断通用逻辑层
- Easy-Ui错误之SyntaxError: function statement requires a name解决办法
- Android之图片工具类ImageUtil
- 深入理解java虚拟机(三)(一个类加载器只初始化一次类对象,不同类加载器可以对同一类对象进行初始化)
- python注释
- 【LeetCode】292. Nim Game(推理,智力题)
- 启动触发器,关闭触发器
- 哈夫曼编码和哈夫曼树的实现——Pascal实现
- 1105 Spiral Matrix
- 2016.01.05 DOM笔记(一) 查找元素
- visual 调试
- Jdbc Url 设置allowMultiQueries为true和false时底层处理机制研究
- [Hadoop]源码分析(1)----FileSytem
- Javascript中判断数组的正确姿势
- android 打包失败
- 迟到的2015年末总结
- 分析iOS Crash文件,使用命令符号化iOS Crash文件