470,855 Members | 1,149 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

python's thread problem on Linux platform

I found that multi-threaded program(io-centralize ) runs very slowly
on linux while the same program runs very quickly on windows.If I
change the thread number to one ,the program runs quickly on linux, in
fact the speed is quicker than the multi-threaded version .
It turns out that python's multi-thread support on linux has some
problems.Any comments?

Apr 22 '06 #1
2 1023
de*****@gmail.com wrote:
I found that multi-threaded program(io-centralize ) runs very slowly
on linux while the same program runs very quickly on windows.If I
change the thread number to one ,the program runs quickly on linux, in
fact the speed is quicker than the multi-threaded version .
It turns out that python's multi-thread support on linux has some
problems.Any comments?


Yes. There is a bug in your code.

--Irmen
Apr 22 '06 #2
de*****@gmail.com wrote:
I found that multi-threaded program(io-centralize ) runs very slowly
on linux while the same program runs very quickly on windows.If I
change the thread number to one ,the program runs quickly on linux, in
fact the speed is quicker than the multi-threaded version .
It turns out that python's multi-thread support on linux has some
problems.Any comments?


You are probably looping or have other quirks', over-lock-ing ...

Python's thread/threading/Queue stuff is unfortunately Java-ish/
OS-mindset and not functional. Thus encourages screwing "ego threads".

Maybe you get things organized frictionless with those 2? :

http://aspn.activestate.com/ASPN/Coo.../Recipe/491281
http://aspn.activestate.com/ASPN/Coo.../Recipe/491280

-robert
Apr 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

38 posts views Thread by Anthony Baxter | last post: by
reply views Thread by Bruce Davis | last post: by
10 posts views Thread by Andrew Dalke | last post: by
11 posts views Thread by Grant Edwards | last post: by
852 posts views Thread by Mark Tarver | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.