Multithreading and Minimized Window

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
J2T
Posts: 48
Joined: Sat Sep 20, 2008 6:20 pm
Contact:

Multithreading and Minimized Window

Post by J2T »

Hi Norbo,

i recognized that when i minimize the window of our game that i can't restore it by clicking ob the tab in the taskbar (results in just the error ping sound). Through updating to older revision i found out that this is caused through the multithreading initialize.

Code: Select all

 if (Environment.ProcessorCount > 1)
            {
                for (int i = 0; i < Environment.ProcessorCount; i++)
                {
                    space.threadManager.add();
                }

                space.useMultithreadedUpdate = true;
            }
When i simple comment this part out it works fine. I throught it was a problem of BEPU and checked the demos. But there the minimize and restore works fine with multithreading. Uncommented some mouse und cameraupdate parts to make this even possible.

Do you have any idea why it doesn't work in our game?I know this can caused by several other thinks like our inputsystem. But in fact, don't use multithreadinginitialization works. So may i just forgot to inform BEPU when the app goes inactive or something like this.

Thanks.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Multithreading and Minimized Window

Post by Norbo »

I'm not aware of any direct reason that using multiple threads in the thread manager would interfere with maximizing an application. The operating system should be able to handle scheduling the threads while minimized without any problem, as it appears to do in the demos case.

How much of the CPU is being used when it is stuck minimized versus working normally? What kind of processor do you have? If you'd like, I can also try running it on my computer (quad core Q6600 processor) to see if the problem can be reproduced on different systems.
J2T
Posts: 48
Joined: Sat Sep 20, 2008 6:20 pm
Contact:

Re: Multithreading and Minimized Window

Post by J2T »

With focus on window the CPU usage is around 30% and minimized under 10%. Seems normal so far.

I have a Athlon 64 X2 Dual 6000+.

Thanks for the offer but i've tested it on five different system for now and the result is always the same :(

So the only thing i can do is to go deeper in the demos especially the input. May there is a clear difference compared to our game.

Thanks so far.
Post Reply