Created
June 15, 2014 06:17
-
-
Save zlx/10eab72f9722257abcfa to your computer and use it in GitHub Desktop.
An fork example
This file contains hidden or 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
puts "parent process pid is #{Process.pid}" | |
if fork | |
puts "entered the if block from #{Process.pid}" | |
else | |
puts "entered the else block from #{Process.pid}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment