
February 18th, 2013, 11:43 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 7
Time spent in forums: 3 h 1 m 4 sec
Reputation Power: 0
|
|
|
Duplicate logs while spawning two threads
Hi,
While spawning two different threads using Thread from threading module i am getting duplicate logs in log file.
Creating two threads in this way :
t = Thread(target = check_Input_Status_Action.thresholdCheck, args = (thresholdTime,))
t.start()
t1 = Thread(target = check_Input_Status_Action.main, args = (sys.argv,))
t1.start()
But if call the above two statements with small sleep in between them then the duplicate log problem doesn't coming.
Could you please help me in knowing that when we spawn two threads in the consecutive statements does this problem occur or do we need to give some time lag in while calling these two statements.
Thanks
|