Skip to content

Instantly share code, notes, and snippets.

@yorickpeterse
Created July 17, 2015 21:00
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 yorickpeterse/b58e785db4622aef5c9e to your computer and use it in GitHub Desktop.
Save yorickpeterse/b58e785db4622aef5c9e to your computer and use it in GitHub Desktop.
require 'oga'
require 'thread'
xml = <<-EOF
<people>
<person>
<name>Alice</name>
</person>
</people>
EOF
threads = 100.times.map do
Thread.new do
loop do
Oga.parse_xml(xml)
end
end
end
threads.each(&:join)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment