python's thread problem on Linux platform

D

devdoer

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?
 
I

Irmen de Jong

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
 
R

robert

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/Cookbook/Python/Recipe/491281
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491280

-robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top