Thread priority or keeping a (wx)GUI responsive

Discussion in 'Python' started by NoelByron@gmx.net, Nov 2, 2006.

  1. Guest

    I need to do some intense calculations in my application. Those are
    done by a third party Python library and consume 100% CPU time for some
    seconds. The computations take place in their own thread to keep my GUI
    responsive (wxPython in my case).

    Everything works fine on a dual core machine. On a single CPU machine,
    the computation slows down the whole GUI (better, the whole machine).
    The ideal solution in my case would be to give the computation thread a
    very low priority. But I fear that is not possible?

    Moving the computations to a different process look quite complex since
    the result is a large Python data structure. And I fear it would not
    solve the problem since I can only influence the priority of a
    subprocess on the windows plattform (I refer to the documentation of
    the subprocess module).

    Another possible solution is to include some idle times
    (time.sleep(0.05) or wxYield() or even better with python yields?) in
    the algorithm of the computations. Ugly, since I would have to
    manipulate a third party library. Could sys.setcheckinterval() help?

    Do I miss something? Any help, tips or advice would be appreciated.

    Best regards,
    Noel
     
    , Nov 2, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frank
    Replies:
    0
    Views:
    340
    Frank
    Nov 21, 2003
  2. =?Utf-8?B?SmF3YWhhcg==?=

    ASPX page un responsive. after opening Modal Dialog

    =?Utf-8?B?SmF3YWhhcg==?=, Sep 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    505
    Lau Lei Cheong
    Sep 30, 2004
  3. James Nugent
    Replies:
    4
    Views:
    843
  4. FutureScalper

    Setting GUI thread priority

    FutureScalper, Jan 12, 2008, in forum: Java
    Replies:
    6
    Views:
    2,635
    Arne Vajhøj
    Jan 16, 2008
  5. Marcel Müller
    Replies:
    3
    Views:
    593
    Marcel Müller
    Apr 27, 2009
Loading...

Share This Page