Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
Python多线程模型
我已经研究 python 中的多线程有一段时间了 但是我对一些问题感到困惑 首先 python线程库创建的线程是用户级线程还是内核级线程 书上说用户级线程必须映射到内核线程并且 操作系统仅创建和维护内核级线程 python中将使用哪种线程模
Multithreading
pythonmultithreading
使用 futures.ProcessPoolExecutor 但不使用带有 PRAW 包装器的 futures.ThreadPoolExecutor 时出现递归最大错误
我正在使用此代码来抓取 API submissions get submissions 1 with futures ProcessPoolExecutor max workers 4 as executor or using this w
Python - 在 Windows 中的多进程下创建线程时出现“can't pickle thread.lock”错误
我陷入了我认为的基本多进程和线程问题 我已经设置了一个多进程 其中有一个线程 但是 当我在其中设置线程类时init函数 我收到以下错误 类型错误 无法pickle thread lock对象 但是 如果线程是在线程之外设置的 则不会发生这种
python
python27
multiprocessing
pythonmultithreading
为什么线程会增加处理时间?
我正在研究基本的 2 D DLA 模拟的多任务处理 扩散有限聚集 DLA 是指粒子执行随机游走并在接触当前聚集时聚集 在模拟中 我有 10 000 个粒子每一步都向随机方向行走 我使用一个工作池和一个队列来喂养它们 我给它们提供一系列粒子
python
Multithreading
python27
pythonmultithreading
Bottle gevent 和线程:gevent 只能在单个线程中使用
我有一个 python Bottle 应用程序 它使用线程 由于我正在使用猴子补丁 http www gevent org gevent monkey html 线程正在阻止应用程序执行 从线程触发的对话框正在阻止瓶子路由响应客户端 直到被
python
Bottle
gevent
pythonmultithreading
提高 python 脚本的吞吐量
我正在通过 dig 处理来自 DNSBL 的数千个域名列表 创建 URL 和 IP 的 CSV 这是一个非常耗时的过程 可能需要几个小时 我的服务器的 DNSBL 每十五分钟更新一次 有没有办法可以提高 Python 脚本的吞吐量以跟上服务
python
unix
pythonmultithreading
join()在线程中有什么用?
我正在研究 python 线程并遇到join http docs python org 2 library threading html threading Thread join 作者告诉我 如果线程处于守护进程模式 那么我需要使用joi
python
Multithreading
pythonmultithreading
用于运行异步请求的 Python Celery 与线程库 [关闭]
Closed 这个问题是基于意见的 help closed questions 目前不接受答案 我正在运行一个解析大量数据的 python 方法 由于它是时间密集型的 我想在单独的线程上异步运行它 以便用户仍然可以访问网站 UI 如果用户退
python
Celery
djangocelery
pythonmultithreading
在多个线程中重用 Tensorflow 会话会导致崩溃
背景 我有一些复杂的强化学习算法 我想在多个线程中运行 Problem 当尝试打电话时sess run在一个线程中我收到以下错误消息 RuntimeError The Session graph is empty Add operation
python
python3x
Multithreading
tensorflow
pythonmultithreading
从线程返回值
在 Python 中 如何让线程将元组或我选择的任何值返回给父级 我建议你实例化一个队列 队列 http docs python org library queue html highlight queue Queue Queue在启动线程
python
Multithreading
pythonmultithreading
exitcode
在 python 中并行化这个嵌套 for 循环
我再次努力提高这段代码的执行时间 由于计算确实非常耗时 我认为最好的解决方案是并行化代码 我首先使用地图 如中所述this https stackoverflow com questions 29217088 parallelize a n
python 3.7 多线程中的 GIL 行为
我正在研究并尝试了解 python GIL 以及在 python 中使用多线程的最佳实践 我发现这个演示文稿 https www dabeaz com python UnderstandingGIL pdf and 这个视频 https w
python
Multithreading
pythonmultithreading
GIL
多线程Python网络爬虫卡住了
我正在编写一个Python网络爬虫 我想让它成为多线程的 现在我已经完成了基本部分 以下是它的作用 一个线程从队列中获取一个url 线程从页面中提取链接 检查链接是否存在于池 集合 中 并将新链接放入队列和池中 该线程将 url 和 htt
python
Multithreading
pythonmultithreading
Python 什么时候重置线程计数?
假设一个主程序创建 5 个线程 一次一个 main py import threading import time from camera import Camera this class inherits threading Thread
python
Multithreading
pythonmultithreading
线程中的类型错误。函数接受 x 位置参数,但给出 y [重复]
这个问题在这里已经有答案了 我现在正在使用Python 我有一个start function 从消息中获取字符串 我想为每条消息启动线程 目前的线程应该像这样打印出我的消息 def startSuggestworker message pr
python
pythonmultithreading
Python 多处理:同步类文件对象
我正在尝试创建一个类似对象的文件 该对象在测试期间分配给 sys stdout sys stderr 以提供确定性输出 它并不意味着快速 只是可靠 到目前为止我所拥有的almost有效 但我需要一些帮助来消除最后几个边缘情况错误 这是我当前
python
Multithreading
multiprocessing
python26
pythonmultithreading
如何在Python中获取线程id?
我有一个多线程Python程序和一个实用函数 writeLog message 写出时间戳 后跟消息 不幸的是 生成的日志文件没有给出哪个线程正在生成哪个消息的指示 我想writeLog 能够在消息中添加一些内容来识别哪个线程正在调用它 显
python
Multithreading
pythonmultithreading
pythonlogging
pow 函数使用 ThreadPoolExecutor 阻塞所有线程
尽管关于 ThreadPoolExecutor 的第一个示例使用了 pow 函数 https docs python org 3 library concurrent futures html https docs python org 3
python
Multithreading
pythonmultithreading
concurrentfutures
Python线程问题,raw_input()阻塞线程,线程失控
我在 python 中遇到线程问题 问题似乎是当我调用一个线程并随后调用 raw input 时会阻塞该线程 这是最小的例子 import threading import time class tread test threading T
python
python27
pythonmultithreading
Python 多处理:类型错误:__new__() 缺少 1 个必需的位置参数:'path'
我目前正在尝试使用 joblib 库和多处理后端在 python 3 5 中运行并行进程 但是 每次运行时我都会收到此错误 Process ForkServerPoolWorker 5 Traceback most recent call
python
RuntimeError
pythonmultithreading
pythonmultiprocessing
joblib
1
2
3
4
5
»