February 18th, 2013, 11:43 PM
Duplicate logs while spawning two threads
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,))
t1 = Thread(target = check_Input_Status_Action.main, args = (sys.argv,))
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.
February 19th, 2013, 09:32 AM
Temporal delay usually isn't the best answer. Investigate mutual exclusion.
[/code] are essential for python code and Makefiles!