由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 使用CPython要避免多线程?
相关主题
我知道为啥ruby这些framework没有用v8引擎原理的原因了python太慢了
来,讨论个问题这次node把python也给干了
有一点我不同意公孙大神说的蜥蜴和好虫掐起来了
为什么我认为 Python 3 没有前途?(zz)Node 完胜 Ruby呀
python Global Lock说了半天异步是大势所趋没什么疑问了
最近在看《python源码剖析》狗狗抛弃Java转投swift?
刚开始看pythonpython下怎么解决GIL?
大家难道全是半路出家?有人熟悉Python里的threading吗
相关话题的讨论汇总
话题: cpython话题: gil话题: 多线程话题: 避免话题: stm
进入Programming版参与讨论
1 (共1页)
l*********8
发帖数: 4642
1
http://wiki.python.org/moin/GlobalInterpreterLock
上面说CPython用的GIL degrades performance.
所以我们使用CPython要避免多线程?
d***q
发帖数: 1119
2
yep...thread implementation of python 2.x sucks..so try to avoid threads.
use multi process for cpu intensive tasks
and async IO or coroutine for io tasks.
l*********8
发帖数: 4642
3
Thanks!
And GIL is still there in CPython 3.1. I hope the problem will be solved
soon.

【在 d***q 的大作中提到】
: yep...thread implementation of python 2.x sucks..so try to avoid threads.
: use multi process for cpu intensive tasks
: and async IO or coroutine for io tasks.

p**o
发帖数: 3409
4
GIL in CPython is likely to exist forever.
积重难返

【在 l*********8 的大作中提到】
: Thanks!
: And GIL is still there in CPython 3.1. I hope the problem will be solved
: soon.

d***q
发帖数: 1119
5

Because python use reference-counting so it would be quite hard to remove
GIL completely.
If you are really care about this issue there are two options:
1: you may try pypy & its experimental module: STM it is said that STM has
already worked with multi cores directly. However it is far away from
production usage.
2: use other implementations like Jython, IronPython or event other
languages..

【在 l*********8 的大作中提到】
: Thanks!
: And GIL is still there in CPython 3.1. I hope the problem will be solved
: soon.

1 (共1页)
进入Programming版参与讨论
相关主题
有人熟悉Python里的threading吗python Global Lock
Node.js is not suitable for generic web projects最近在看《python源码剖析》
问一个python multiprocessing问题刚开始看python
请教一个Node.js的疑惑大家难道全是半路出家?
我知道为啥ruby这些framework没有用v8引擎原理的原因了python太慢了
来,讨论个问题这次node把python也给干了
有一点我不同意公孙大神说的蜥蜴和好虫掐起来了
为什么我认为 Python 3 没有前途?(zz)Node 完胜 Ruby呀
相关话题的讨论汇总
话题: cpython话题: gil话题: 多线程话题: 避免话题: stm