Skip to content

Instantly share code, notes, and snippets.

@rendon
Created July 6, 2017 01:49
Show Gist options
  • Save rendon/b79bfdb02fb519ae76551df66aef0d46 to your computer and use it in GitHub Desktop.
Save rendon/b79bfdb02fb519ae76551df66aef0d46 to your computer and use it in GitHub Desktop.
Thread excercise
You have a list of numbers, each number is in the range [1,1,000,000], you want
to find the prime factors of all of them. As usual you want to process the list
in the least amount of time, that's why you will will try to parallelize the process.
Implement an algorithm to process the list using threads, at any point you should have at most 8 threads running.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment