While I like the answer by Jan, this might help to improve upon it.
Parallel Prime Sieve: Finding Prime Numbers