2
Answers

Affinity New Dual core PC

Ask a question
Martin

Martin

17y
4.8k
1
Hi I recently developed a serial port terminal program, using the standard C# SerialPort class etc on an old intel P4 computer. Everything runs fine. We have upgraded out PCs to dual core Intels, and now when I run the program, after an unspecified time, the program comes up with AccessViolationException was unhandled "Attempted to read or write protected memory. This is often an indication that other memory is corrupt.". If I run the program, and go into task manager and disable one of the cores on the affinity tab, all runs fine and the program runs for hours. Is there any way for me to fix this without turning a core off as surely this should be possible? but if I do need to turn a core off, can I do it with code instead of using Task Manager> I have done this before on a c++ program using SetProcessAffinityMask(hProcess ,1); but can't find the equivalent in C# I have included the stack trace below TIA

Answers (2)
Next Recommended Forum