Created
November 24, 2013 00:54
-
-
Save lextoumbourou/7621997 to your computer and use it in GitHub Desktop.
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
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