-
-
Save davydovanton/5c1b9255bf2e5634c143 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Какой результат будет в MRI, Jruby, rubinius при выполнении следующего кода? | |
# Почему так происходит. Как можно улучшить данный код. | |
array = [] | |
10.times do | |
Thread.new do | |
10.times { array << nil } | |
end | |
end | |
array.size | |
# 2. Что произойдет в mri если http://somesite.org будет не доступен? | |
require 'open-uri' | |
3.times.map do | |
Thread.new do | |
open('http://somesite.org') | |
end | |
end.each(&:value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment