G
Guest
I have an application that consists of a managed C++ wrapper around an
unmanaged C++ "engine" that performs a very processor intensive task. In
the application I create two instances of the managed wrapper (and therefore
of the unmanaged engine) on separate threads so that it can be working on two
scenarios at the same time. The engine keeps track of certain counters so
that I can monitor it's progress.
However, I'm finding that the engine executes at different speeds on
different occasions when I run the application with exactly the same
scenarios. In fact, sometimes one instance of the engine runs at the speed
I'm expecting and the other runs at about one tenth of the normal speed, even
though they are instances of exactly the same code, running on a dual core
processor with nothing else running at the same time.
I find myself running the application, checking the speed, and, if it's not
running at the normal speed I shut it down, start it again, check the speed,
etc, until, for no apparent reason, it starts up running at full speed. It's
the only way I can find to get the application working at full potential on
both threads and it's very annoying!
Does anyone have any idea what might be causing this? I'm still a C++
beginner so I'm hoping this can be fixed with a compiler option or two.
I'm using VC++ 2005 on a Pentium D and Win2K.
Thanks in advance.
unmanaged C++ "engine" that performs a very processor intensive task. In
the application I create two instances of the managed wrapper (and therefore
of the unmanaged engine) on separate threads so that it can be working on two
scenarios at the same time. The engine keeps track of certain counters so
that I can monitor it's progress.
However, I'm finding that the engine executes at different speeds on
different occasions when I run the application with exactly the same
scenarios. In fact, sometimes one instance of the engine runs at the speed
I'm expecting and the other runs at about one tenth of the normal speed, even
though they are instances of exactly the same code, running on a dual core
processor with nothing else running at the same time.
I find myself running the application, checking the speed, and, if it's not
running at the normal speed I shut it down, start it again, check the speed,
etc, until, for no apparent reason, it starts up running at full speed. It's
the only way I can find to get the application working at full potential on
both threads and it's very annoying!
Does anyone have any idea what might be causing this? I'm still a C++
beginner so I'm hoping this can be fixed with a compiler option or two.
I'm using VC++ 2005 on a Pentium D and Win2K.
Thanks in advance.