On Wed, Oct 23, 2013 at 11:41 AM, Vittorio Spina <[email protected]>wrote:
> quindi in pratica un ciclo su un vero thread separato e un ciclo nel main
> che si scambiano una variabile?
from multiprocessing import Process, Value
import time
num = Value('i', 0)
def do_something():
while 1:
num.value += 1
p = Process(target=do_something)
p.start()
while 1:
print num.value
time.sleep(1)
è solo un esempio preso paro paro dal tuo codice sui threads
però ti conviene approfondire i Manager, Queue e Pipe
_______________________________________________
Python mailing list
[email protected]
http://lists.python.it/mailman/listinfo/python