0

I am using the taskset tool to set CPU affinity for my multithreaded Rust program which queries data from MongoDB:

taskset -c 16-31 cargo run

When I run this command, I find that the program will also run on other CPUs as observed from htop. What went wrong and how to I solve this?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
YjyJeff
  • 833
  • 1
  • 6
  • 14
  • Can you provide a program that reproduces this? As far as I understand it, CPU affinity should be inherited by all child processes, even from Cargo to the actual application. – E_net4 May 13 '17 at 10:49
  • 5
    Have you tried running your program directly instead of running it via Cargo? `taskset -c 16-31 target/...` (`cargo run` should print the path to the executable) – Francis Gagné May 13 '17 at 11:38

0 Answers0