In user mode, there is no exact way. And Windows is basically trying to prevent applications from overloading all system resources. But you could probably isolate most of the other processes with a different core / processor so that your code can run on the main core of it.
Start by searching in this code here on MSDN for a listing of processes. In addition to the enumeration code, PROCESS_SET_INFORMATION will be indicated as the OpenProcess flag. Most likely, you will need your code running with admin privs to do this for processes that do not work like your NT credits. For each handler being processed, call SetProcessAffinityMask to configure the process on all but one of the cores. Then set your process to run another on the backup kernel that you selected from all the other process descriptors.
This will not handle other processes when starting and balancing the load in the kernel on which you are trying to run your code.
Your mileage may vary. If it's just for testing or for machines dedicated to your code, then this is likely to be good. If this is for a commercial application designed to work with all other applications, customers will be terribly disappointed to see all their other applications and service tanks when they run your code. Protector carefully.
source share