Skip to content

Instantly share code, notes, and snippets.

@Araq
Created July 1, 2015 00:09
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 Araq/8022f703001bf59e5ed2 to your computer and use it in GitHub Desktop.
Save Araq/8022f703001bf59e5ed2 to your computer and use it in GitHub Desktop.
pin
var
a: array[2, Thread[int]]
proc worker(x: int) =
while true:
echo x
createThread(a[0], worker, 1)
createThread(a[1], worker, 2)
pinToCpu(a[0], 0)
pinToCpu(a[1], 1)
joinThreads(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment