Skip to content

Instantly share code, notes, and snippets.

@timuruski
Created November 5, 2010 23:26
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 timuruski/665032 to your computer and use it in GitHub Desktop.
Save timuruski/665032 to your computer and use it in GitHub Desktop.
require 'logger'
forks = 4
a = 0
b = 400 # 649976
forks.times do |i|
Kernel.fork do
log = Logger.new("/Users/#{`whoami`.strip}/tmp/log-#{i}.log")
count = (b-a) / forks
puts "#{count * i} - #{count * i + count}"
c = ((count * i)..(count * i + count))
c.each do |n|
log.info n
end
end
Process.wait
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment