首页 > 编程语言 > 详细

Python进程/线程相关

时间:2017-01-23 21:46:57      阅读:219      评论:0      收藏:0      [点我收藏+]

1、获取进程ID。(getpid

os.getpid()

2、获取父进程ID。(getppid

os.getppid()

3、获取线程ID。(get_ident

(1)、进程内局部标识。

import threading
threading.get_ident()
threading.current_thread().ident

(2)、系统全局标识:python下使用ctypes获取threading线程id



*** walker ***


本文出自 “walker的流水账” 博客,请务必保留此出处http://walkerqt.blog.51cto.com/1310630/1893879

Python进程/线程相关

原文:http://walkerqt.blog.51cto.com/1310630/1893879

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!