Created
June 17, 2015 17:28
-
-
Save otherwiseguy/630d390b8d187f1fd9af 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
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