Skip to content

Instantly share code, notes, and snippets.

@lextoumbourou
Created November 24, 2013 00:54
Show Gist options
  • Save lextoumbourou/7621997 to your computer and use it in GitHub Desktop.
Save lextoumbourou/7621997 to your computer and use it in GitHub Desktop.
from os import fork, getppid
from time import sleep
pid = fork()
if pid == 0:
print "I'm about to become an orphan!"
for _ in range(3):
sleep(1)
print "My parent is", getppid()
else:
print "Parent here, I just created child", pid
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment