summaryrefslogtreecommitdiff
path: root/code/snippets/if_fork_pid.rb
blob: 2c3c262d907a07c4c83899c649c02c16d969db29 (plain)
1
2
3
4
5
6
7
8
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