Last active
January 2, 2016 12:39
-
-
Save SergioLarios/8305014 to your computer and use it in GitHub Desktop.
This file contains 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 threading | |
import time | |
# Cantidad de procesos | |
cantidad_procesos = 5 | |
# Proceso Infinito | |
def proceso_infinito(numero): | |
while True: | |
time.sleep(1) | |
print numero | |
return | |
# Ejecucion | |
for p in range(1, cantidad_procesos): | |
t = threading.Thread(target=proceso_infinito, args = (p,)) | |
t.daemon = True | |
t.start() | |
while True: | |
time.sleep(1) | |
print "Ejecuntado ..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment