views:

53

answers:

1

I have a C++ app that uses a Jet database through DAO. Large queries work well up through Vista but lockup under Win7 on a multicore machine. I have tried both jet 3.5 and 4.0. Both fail. I have tried disabling threads in calling prog (my app) - still fails.

A: 

Calling SetProcessAffinityMask(1<<GetCurrentProcessorNumber()) is a rather brute-force way of restricting yourself to the current core only. But it's of course better to use a debugger to determine why it locks up. Which two threads deadlock?

MSalters
Thanks, that is working well. I check for OSVERSIONINFO with MajorVersion 6 or higher then check SYSTEM_INFO for NumberOfProcessors 2 or more. Then pick a CPU using random number to spread out the load the best I can and SetProcessAffinityMask for the CurrentProcess and that CPU.
MighMoS
Regarding the specifics of the problem I've learned that this is not a DAO only problem. I created a test app where I submit the query via OleDb (Provider=Microsoft.Jet.OLEDB.4.0), I get the same hang. The statement (incredibly) is just: SELECT SUM([Amount1]) FROM main My file does have 320,000 records,
MighMoS
Do you have the same versions of Jet on the machines where the results differ?
David-W-Fenton
You don't actually need to check whether you have two processors. On a one-processor one-core machine, you will find that you are running on core #0 and restrict yourself to that core - which you were anyway. The reason I didn't use a random number was because the current core was already picked by the OS as a suitable one.
MSalters
GetCurrentProcessorNumber works well you just have to make sure you don't try it in XP. Yes same versions of Jet on both machines.User downgraded to Vista and still has problem. My current thinking is that the users with the problem are all using Intel I7 and Xeon.
MighMoS