I have timer created with a function timer_create(CLOCK_REALTIME, &events, &timer)
, where timer is a unique per process timer ID (according to man).
Now there is sched_setaffinity
function to set affinity for a given PID.
How can I set affinity for my timer? Not the whole program, but only the timer thread. I am not sure that timer ID is the same thing as PID.
Ok, I got the answer.
One way to do this is like that:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.