Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 01936996fe
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (18 sloc) 0.472 kb
#
# Processes can Fork
#
# Child processes inherit
# 1) copy of all of the memory in use by the parent process
# 2) copy of all of the open file descriptors
# fork clones current process
# fork returns twice
if child_pid = fork
# child_pid == child PID in parent process
puts "It's the parent #{Process.pid}"
else
# child_pid == nil in child process
puts "It's the child #{Process.pid}"
end
# both processes continue execution
puts Process.pid
# both exit
Jump to Line
Something went wrong with that request. Please try again.