Avoid the use of sleep and implement synchronisation between the functions properly using python threads.
Avoid the use of sleep and implement synchronisation between the functions properly using python threads.