function as its target then we used start(method to start the python thread synchronizing threads the threading module provided with python includes simple-toimplement locking mechanism that allows you to synchronize threads new lock is created by calling the lock(methodwhich returns the new lock the acquire(blockingmethod of the new lock object is used to force threads to run synchronously the optional blocking parameter enables you to control whether the thread waits to acquire the lock if blocking is set to the thread returns immediately with value if the lock cannot be acquired and with if the lock was acquired if blocking is set to the thread blocks and wait for the lock to be released the release(method of the new lock object is used to release the lock when it is no longer required import threading import time class mythread (threading thread)def __init__(selfthreadidnamecounter)threading thread __init__(selfself threadid threadid self name name self counter counter def run(self)print "starting self name get lock to synchronize threads threadlock acquire(print_time(self nameself counter free lock to release next thread threadlock release(def print_time(threadnamedelaycounter)while countertime sleep(delayprint "% % (threadnametime ctime(time time())counter -