Home > not-especially-impressive-multiprocessed-prime-finder

not-especially-impressive-multiprocessed-prime-finder

Not-especially-impressive-multiprocessed-prime-finder is a project mainly written in Ruby, it's free.

As the project name says, not impressive. Made for playing around with multiprocessing via IO.popen.

This is a program made just for testing out the ability to do some processing in Ruby in parallel via IO.popen. The way primes are found is slow. The way the processing is handled isn't too impressive. It was made as a test and some people showed interest in it. That's all.

To run the program, provide two arguments: the number you want to find the primes up to (eg: 100 -> find prime numbers up to 100) and the number of child processes to allow (5 -> a max of five at once). There's no error checking so give reasonable values. sample: ruby main.rb 1000 8

There's a tiny bit of RSpec stuff I was using to make sure I calculated the primes correctly. I should have done TDD for getting the actual processing steps done as well, but I wasn't sure how RSpec would mesh with a bunch of IO.popen spawned processes. Might add that later and see what happens. To run the specs, do this: rspec -I. spec