While spawning two different threads using Thread from threading module i am getting duplicate logs in log file.
Creating two threads in this way :
- Code: Select all
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.