Last active
June 21, 2019 02:26
-
-
Save satoryu/5efb4c3ff41ab71d3869504a86b173ba to your computer and use it in GitHub Desktop.
Spike code to confirm how Process and its fork work
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
chpid = Process.fork do | |
10.times do | |
STDOUT.puts "Foo" | |
sleep 1 | |
end | |
end | |
puts "Child process started" | |
Process.waitpid(chpid) | |
puts "End" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment