Created
August 31, 2013 22:29
-
-
Save kjs3/6401062 to your computer and use it in GitHub Desktop.
fork is making irb unresponsive
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
# This makes irb sluggish and randomly unresponsive | |
if fork | |
puts "Hello from parent process #{Process.pid}" | |
else | |
puts "Hello from child process #{Process.pid}" | |
# I thought the child process would exit automatically here? | |
end | |
# This works fine | |
if fork | |
puts "Hello from parent process #{Process.pid}" | |
else | |
puts "Hello from child process #{Process.pid}" | |
exit | |
end | |
# back to parent irb process |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment