Skip to content

Instantly share code, notes, and snippets.

@SergioLarios
Last active January 2, 2016 12:39
Show Gist options
  • Save SergioLarios/8305014 to your computer and use it in GitHub Desktop.
Save SergioLarios/8305014 to your computer and use it in GitHub Desktop.
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