python - Threading.thread() 在线程内创建线程?
问题描述
我有以下模块:
def monitor(self):
# Do something
periodic_thread = threading.Timer(30, self.monitor)
periodic_thread.start()
这是否意味着,我们每 30 秒在一个线程中创建一个线程?如果我打印 current_thread,我有以下结果:
<_MainThread(MainThread, started 139936578074432)>
<_Timer(Thread-1, started 139936378812160)>
<_Timer(Thread-2, started 139936370419456)>
<_Timer(Thread-3, started 139936378812160)>
解决方案
推荐阅读
- javascript - 无法在 Highcharts 中更新数据表
- database - 将 kafka 与 Odoo 集成
- groovy - SoapUI使用groovy在延迟步骤中更改毫秒值
- python - 获取 http://localhost:5000/data 404(未找到)
- r - 使用 uncount 在 r 中复制某些列但不复制其他列
- leaflet - 传单将米转换为像素
- java - 从文件读取 Java OOP 聚合
- azure - Microsoft Graph $top 过滤器返回不一致的结果
- javascript - Firebase 数据库安全规则 - 根据动态 CustomClaim 名称设置访问权限
- nginx - 使用 Cloudflare 和 nginx 的子域代理通行证