Windows Under The Hood issue
Hi,
I (or actually we) have a tricky performance issue with our simulator that was annoying a couple of years ago but has now become a real problem. The application does not hang, but it produces a ton of error printouts that does not exist in real life i.e. when the application runs in the target (not in PC).
Background:
The simulator consist of a couple of win32 console applications, written in C++. When the console applications starts up, they instantly creates a second window that have the GUI. We usually start at least four (4) different applications that communicates (IPC) with each other through a memory mapped file, where we use system calls like PulsEvent, Mutex and Semaphores. Furthermore - we are using MetaWINDOW from Metagraphics Software Corporation, mainly because its fast and can run in both Windows and on the target system with a RTOS. But once again, the performance problem is in the simulator i.e. PC with Windows.
Problem description:
The PC (Wintel) that runs our simulator must be connected to the Intra-net/Internet in order to work and perform properly. And here comes the funny part: It even performs better if we start up IE/FireFox and have a home page that contains... well we don't know actually, like www.times.com. So our application when running as a simulator in Wintel is addicted to be connected to Internet, have a browser with some specific home pages !!
Our conclusion:
We think that since we use some low level win-api commands (Mutex/Semaphores) in our applications and those are surely used by the browsers and in extent the network drivers, Windows itself boosts up the priority of some ActiveX component that is related to the browser functionality. And Voila !! our application is enjoying a free lunch and works fast and smooth! Is this strange/odd? I don't know, it's crazy but it's a fact.
So my question is, does anybody recognize this phenomena and is there any solution to get rid of the dependency of the connection to Intra-net/Internet + browser + some home page? I am grateful of any suggestions what to to, what so ever!
Thanks in advance
Problem is finally solved!!
Thank you guys (matsp & iMalc) for your commitment!
It was actually you IMalc that lead us indirectly to the solution. You wrote "then it has got to be related to the Windows message queue". When I explained the problem to consultant that we engaged, and the just mentioned response from iMalc, he instantly said that it almost certain has to do with the Multimedia timer. It's obvious a common thing that particularly Flash animation increases the granularity of the Multimedia Timer in order to increase overall performance in windows i.e. more Windows messages are posted. As a test, we made a small program that increased the mentioned granularity and was started up just before our Simulator. It actually made our Simulator faster as it was with the mentioned home page in my first posted message above !!
I hope that this information also can be useful for other developers, that struggles with applications that performs worse than expected, or the opposite, unexpectedly good, but only under unexpected circumstances!