Skip to content

Instantly share code, notes, and snippets.

@mono0x
Created October 22, 2013 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mono0x/7101366 to your computer and use it in GitHub Desktop.
Save mono0x/7101366 to your computer and use it in GitHub Desktop.
Set CPU Affinity
class CPUAffinity
def self.set_affinity(mask, pid = Process.pid)
system "taskset -p 0x#{mask.to_s(16)} #{pid}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment