Skip to content

Instantly share code, notes, and snippets.

@StanisLove
Created February 19, 2020 16:33
Show Gist options
  • Save StanisLove/0d31639f5e67990e2cd826ce9e890a9a to your computer and use it in GitHub Desktop.
Save StanisLove/0d31639f5e67990e2cd826ce9e890a9a to your computer and use it in GitHub Desktop.
threads = Array.new(8) do
Thread.new do
while arr.any?
mutex.synchronize do
end
elem = arr.pop
next if elem.nil?
end
end
end
threads.each(&:join)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment