Last active
December 29, 2015 05:29
-
-
Save lextoumbourou/7622016 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, wait | |
from sys import exit | |
from time import sleep | |
pid = fork() | |
if pid == 0: | |
print "Hope my parent doesn't forget me this time!" | |
for _ in range(3): | |
sleep(1) | |
print "Right now, my parent is", getppid() | |
else: | |
wait() | |
print "My child has finished processing. My work here is done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment