Skip to content

Instantly share code, notes, and snippets.

@mono0x
Created October 22, 2013 14:06
Show Gist options
  • Select an option

  • Save mono0x/7101366 to your computer and use it in GitHub Desktop.

Select an option

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