There are probably other ways, but if you know your process is running on only a single selected core (it should not be CPU0), then why not give your process a high priority? I suppose it might depend if this is a user space application or kernel space, but it sounds like you mean user space.
A normal user space priority is “0”. A higher priority to “not be as nice” to other processes, which would be a rather high priority for your process, would be “-5” or “-10” (you’re asking for trouble if go much higher priority without a really good reason). It requires root authority to become “less nice” (negative nice number for higher priority), but you can non-programmatically test this on the command line with the “nice” command (or the “renice” command.
If you are ok testing as root, then just use the “nice” command when starting your program. If you want to run your program as a regular user, then start it, find the PID, and use sudo with “renice”. If all of this works out, then there are C functions you can call to do this inside of your program (which won’t get around needing root authority).
Check out “man -a nice” and “man renice”.
If that does not do the job, then you can look into actually excluding processes other than yours from working on the CPU core. Just a reminder since it is important, but do not mess with CPU0. Only do this on other cores.