Skip to content

Instantly share code, notes, and snippets.

@otherwiseguy
Created June 17, 2015 17:28
Show Gist options
  • Save otherwiseguy/630d390b8d187f1fd9af to your computer and use it in GitHub Desktop.
Save otherwiseguy/630d390b8d187f1fd9af to your computer and use it in GitHub Desktop.
import eventlet
eventlet.monkey_patch()
import os
import time
def fun():
num = 0
while True:
print num
num += 1
time.sleep(1)
def main():
eventlet.spawn_n(fun)
for i in range(5):
pid = os.fork()
if pid != 0:
break
time.sleep(10)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment