I write a function collect_data to use 4 threads to collect data from 4 websites(say, website a to d) and update the data in a table of mysql, simutanously; In the table, there are 4 fields with each stores data from one website No lock is used when the 4 threads updating the table. The 4 threads collect data and update data in mysql every 10 seconds.
def collect_data(site_list = ['a', 'b', 'c', 'd']):
for site in site_list:
InfoCollectingThread(site).start()
Unfortunatelly, after a periods of running (say 3 hours), there are no new records in mysql. It also seems that some threads dies earlied because the corresponding fields aren't updated earlier.
My question is what problem lies in the processs of my design and any solution? Merry Xmas.