Skip to content

Instantly share code, notes, and snippets.

@madis
Created September 7, 2016 13:53
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 madis/cbe9705b22bf0b0f14d36e3f43e172b8 to your computer and use it in GitHub Desktop.
Save madis/cbe9705b22bf0b0f14d36e3f43e172b8 to your computer and use it in GitHub Desktop.
Testing ruby loading in multiple threads
require 'thwait'
$LOAD_PATH << '/Users/madisnoemme/code/etventure/rbn-be-api'
threads = 10000.times.map {
print "."
Thread.new {
require_relative './rbn/service/xml/mapping'
require_relative './rbn/service/xml/mappings'
}
}
puts "Waiting for #{threads.count} threads"
ThreadsWait.all_waits(threads)
puts "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment