Skip to content

Instantly share code, notes, and snippets.

@lextoumbourou
Created November 24, 2013 00:47
Show Gist options
  • Save lextoumbourou/7621938 to your computer and use it in GitHub Desktop.
Save lextoumbourou/7621938 to your computer and use it in GitHub Desktop.
from os import fork
from time import sleep
# Fork the process
pid = fork()
if pid == 0: # We're in the child process
print "Child process up in this."
else: # We're in the parent process
print "Parent here, I just created child", pid
# Sleep for a second to avoid being dropped back to the shell when the parent finishes
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment