How can I know in a C program, on which physical processor and core my code is running? I\'m using Linux and gcc 4.4.3.
You can get the affinity of the process to a processor using GCC. The CPU affinity APIs might help you out. Are you trying to use this information to ensure your process is not interrupted or such high priority task?