Skip to content

Instantly share code, notes, and snippets.

@v0dro
Created May 24, 2018 09:01
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 v0dro/d465589fba704178297592c78fba5a85 to your computer and use it in GitHub Desktop.
Save v0dro/d465589fba704178297592c78fba5a85 to your computer and use it in GitHub Desktop.
# In a calling Ruby script caller.rb
require ‘compiled_binary.so’
def compute_without_gil
t = []
4.times { t << Thread.new { _some_computation }
4.times { t.join }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment