I am trying to do the opposite of the usual. We have a legacy WinCE app which now needs to be ported to the Win32 platform, so that it can work as a simulator of the actual app.
I have managed to get the code compiled and most of the things have started working. But the problem is, the app is heavily multi-threaded. All the threads worked in sync when the app was on WinCE, but, on windows there is absolutely no sync between them.
The app was communicating on serial ports but for long times invalidate doesn't work. At other times, the receiving thread hangs up. Sometimes the data isn't sent at all. Sometimes the thread sends data multiple times over and over again.
Any idea what the difference is between multi-threading in WinCE and Win32? What could be causing this sort of problem?
The app is so big that a design change is next to impossible. Any advice on what I should look into?
I found the problem, all the threads were not getting enough time to process data, which caused tons of timeouts. All i had to do was, put some locks where data was being corrupted and Change
This reduced CPU usage form 95% to barely 10% and got rid of all the problems.