RuntimeError: can't start new thread
明明我只是简单跑了一个数据清洗28W数据的python脚本,不知道怎么就报错如下:

too many threads running within your python process
The "can't start new thread" error almost certainly due to the fact that you have already have too many threads running within your python process,
and due to a resource limit of some kind the request to create a new thread is refused. You should probably look at the number of threads you're creating; the maximum number you will be able to create will be determined by your environment,
but it should be in the order of hundreds at least. It would probably be a good idea to re-think your architecture here;
seeing as this is running asynchronously anyhow, perhaps you could use a pool of threads to fetch resources from another site instead of always starting up a thread for every request. Another improvement to consider is your use of Thread.join and Thread.stop; this would probably be better accomplished by providing a timeout value to the constructor of HTTPSConnection.
RuntimeError: can't start new thread的更多相关文章
- Python 3.5 RuntimeError: can't start new thread
/*********************************************************************** * Python 3.5 RuntimeError: ...
- tcp端口扫描(python多线程)
1 使用单线程扫描单台主机 首先实现的是对单台主机中0-1024端口的扫描,发现差不多每秒扫描一个端口,很慢. import socket def tcp_scanner(host,port): cl ...
- 我的Keras使用总结(3)——利用bottleneck features进行微调预训练模型VGG16
Keras的预训练模型地址:https://github.com/fchollet/deep-learning-models/releases 一个稍微讲究一点的办法是,利用在大规模数据集上预训练好的 ...
- [线程]Thead 中传参数RuntimeError: thread.__init__() not called
在写一个多线程类的时候调用报错 RuntimeError: thread.__init__() not called class NotifyTread(threading.Thread): def ...
- tensorflow_目标识别object_detection_api,RuntimeError: main thread is not in main loop,fig = plt.figure(frameon=False)_tkinter.TclError: no display name and no $DISPLAY environment variable
最近在使用目标识别api,但是报错了: File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/script_o ...
- 解决async 运行多线程时报错RuntimeError: There is no current event loop in thread 'Thread-2'
原来使用: loop = asyncio.get_event_loop()task = asyncio.ensure_future(do_work(checker))loop.run_until_co ...
- Python thread local
由于GIL的原因,笔者在日常开发中几乎没有用到python的多线程.如果需要并发,一般使用多进程,对于IO Bound这种情况,使用协程也是不错的注意.但是在python很多的网络库中,都支持多线程, ...
- [Python]Threading.Thread之Daemon线程
之前对Daemon线程理解有偏差,特记录说明: 一.什么是Daemon A thread can be flagged as a "daemon thread". The sign ...
- python threading.thread
Thread 是threading模块中最重要的类之一,可以使用它来创建线程.有两种方式来创建线程:一种是通过继承Thread类,重写它的run方法:另一种是创建一个threading.Thread对 ...
随机推荐
- OLTP和 OLAP区别
联机事务处理OLTP(on-line transaction processing) 主要是执行基本日常的事务处理,比如数据库记录的增删查改.比如在银行的一笔交易记录,就是一个典型的事务. OLTP的 ...
- HDU-6170 Two strings
http://acm.hdu.edu.cn/showproblem.php?pid=6170 . 匹配任意字符,x* 匹配任意长度的 x (x 为任意字符,长度可以为 0 ) 正则表达式 #inclu ...
- HDU 1811 并查集+拓扑排序
Rank of Tetris 题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1811 Problem Description 自从Lele开发了Rati ...
- MySQL 聚合函数(一)聚合(组合)函数概述
MySQL版本:5.7+ 本节介绍对值的集合进行操作的组合(聚合)函数.翻译自:Aggregate (GROUP BY) Function Descriptions 一.MySQL 5.7中的聚合函数 ...
- 怎样设置cookie生效的域名和路径
Domain 属性指定浏览器发出HTTP请求时, 哪些域名需要附带这个Cookie. 比如 Domain 设置为 example.com, 那 abc.example.com 也会在发起请求时附带这个 ...
- UVA Tress in a Wood
https://vjudge.net/problem/UVA-10214 题意:给定一个坐标系.|x|<=a, |y|<=b 求坐标系中有多少点是可以从原点直接看到(即从原点和一个点连线, ...
- [javascript]localStorage和sessionStorage区别
一.sessionStorage.localStorage.cookie可查看的位置,F12=>Application: 二.cookie .sessionStorage与localStorag ...
- 关于工作单元模式——工作单元模式与EF结合的使用
工作单元模式往往和仓储模式一起使用,本篇文章讲到的是工作单元模式和仓储模式一起用来在ef外面包一层,其实EF本身就是工作单元模式和仓储模式使用的经典例子,其中DbContext就是工作单元,而每个Db ...
- LeetCode 腾讯精选50题--2的幂
在二进制中,2的幂的数字用二进制表示时只会有一位表示为1,其余都为0,基于这个前提,可以有两种方案: 1. 做位移操作 2. 与数值取反并与原数值做与操作,判断是否与原来的数值相同 对于方案1,我的想 ...
- 关于微信小程序中的样式使用变量值的方法
在开发过程中,通常碰到样式非固定的情况,这时候就要使用变量来规定样式,例如,一个view的宽度需要使用变量: 1. 在wxss中,定义变量:width:var(--width--); 2. 在js中, ...