Re: Continuing the saga Non-Blocking GUI developement



Melvin,

As an after thought, the computation you're doing is fairly
complicated isn't it? This isn't a
thread-constantly-polling-for-data-on-socket loop sort of thing,
right?

Paul

On 1/24/07, Paul Davis <pjdavis engineering uiowa edu> wrote:
Melvin,

Is it *just* your app that becomes unresponsive? Or the entire
desktop? Judging from the discussion I'm guessing that you wrote this
with two threads. What I'm guessing is that your background thread has
maxed out an entire processor. If you've only got one thread doing cpu
intensive tasks it makes sense that it works fine on a dual cpu system
and not a single cpu system.

There are two methods I can see to solve this problem. The first and
easiest to test and see if it works is to try and reduce the priority
of your computation thread.

The second is to rework your computational thread so that it
periodically gives up control of the processor so that other process
can run. Quite a bit more complex to accomplish in any meaningful way
and its also quite dependant on the algorithm itself.

> I have no idea how to fix this, I seemed to have made the fatal assumption
> that linux can time slice gthread code... Is this the problem?
>

I'm not entirely certain what you're asking. Of course linux is time
slicing your program. This sounds like a typical resource starvation
issue.

HTH,
Paul




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]