|
Did you mention what OS? If Linux, you can look at /proc/self/stat and depending on the version of your kernel, one of the fields will represent the processor most recently executed on. You can look at the manpage for "proc" to find out which field. You can get the parent id of the process using getppid() and look in /proc/$PPID/stat for the same info.
|