Question

I'm having a problem with a Delphi Pro 6 application that I wrote on my Windows XP machine when it runs on Windows 7. I don't have Windows 7 to test yet and I'm trying to see if Windows 7 might be the source of the trouble. Is there a fundamental difference between the way Windows 7 handles threads compared to Windows XP? I am seeing things happen out of sequence in my error logs on Windows 7 and it's causing problems. For example, objects that should have been initialized are uninitialized when running on Windows 7, yet those objects are initialized on Windows XP by the time they are needed.

Some questions:

1) Are there any core differences that could cause threads/processes to behave differently between the two operating system versions?

2) I know this next question may seem absurd, but does Windows 7 attempt to split/fork threads that aren't split/forked on Windows XP?

3) And lastly, are there any known issues with FPU handling that can cause XP programs trouble when run on Windows 7 due to operational differences in wait state handling or register storage, or perhaps something like Exception mask settings, etc?

4) Any 32-bit versus 64-bit issues that could be creating trouble here?

5) I do use multiple threads but the background threads are fully protected by Critical Sections. Any differences here that I should be concerned about?

-- roschler

Was it helpful?

Solution

Since Windows XP, Microsoft has changed how locks are released so that they don't necessarily transition to the next waiting thread in FIFO order. It's possible that this change may have revealed a race condition in your code that didn't show up under XP.

Some details can be found in Joe Duffy's blog here: Anti-convoy locks in Windows Server 2003 SP1 and Windows Vista

(Unfortunately, I couldn't dig up an actual MS-hosted article - it seems this should be mentioned in some sort of KB article or something)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top