python's thread problem on Linux platform

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • devdoer@gmail.com

    #1

    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?

  • Irmen de Jong

    #2
    Re: python's thread problem on Linux platform

    devdoer@gmail.c om wrote:[color=blue]
    > 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?
    >[/color]

    Yes. There is a bug in your code.

    --Irmen

    Comment

    • robert

      #3
      Re: python's thread problem on Linux platform

      devdoer@gmail.c om wrote:
      [color=blue]
      > 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?
      >[/color]

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




      -robert

      Comment

      Working...