Skip to content

Instantly share code, notes, and snippets.

@sidnei
Created September 11, 2012 19:43
Show Gist options
  • Save sidnei/3701493 to your computer and use it in GitHub Desktop.
Save sidnei/3701493 to your computer and use it in GitHub Desktop.
import os
import sys
import select
import time
import fcntl
#from multiprocessing import Pipe
from billiard import Pipe
parent, child = Pipe()
pid = os.fork()
if pid:
time.sleep(2)
print "parent finished"
sys.exit(0)
else:
for i in xrange(10):
print child.poll(1)
print "child finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment