error handling while multi threading
Im creating a unmanned application that syncs records between a legacy database and a sql database. The application currently gets a range of record IDs by date and time then pulls each record one by one with a single thread and saves them in a database. If an error occurs the process is restarted until the full range completes without errors then the date range is changed for the next sync.
Now i want to replicate this behavior with multiple threads but i don't know how to make a worker thread report to the master thread when a error occurs, so that the sync process can be restarted.
Any insight would be helpful. Thanks in advance.