07/12/2016 5:13 PM
post116537
|
Hi,
Just to be clear - you're looking for the equivalent of Linux's getcpu(2) or glibc's sched_getcpu(3) ? I had a
similar goal in an implementation of ntp's nanosecond kernel for an SMP system. I couldn't find a nicely packaged
solution. You might be able to get what you want by running the DCMD_PROC_TIDSTATUS command on one's own thread and
checking the last_cpu field. I needed something safe to run even in an ISR (so I could capture timestamps with the
lowest possible latencies), so I never investigated that solution further.
-Will
|
|
|