I am using the Python Queue cclass to manage a list of tasks that are shared between multiple worker threads. The actual code is humungous and I'm still in the process of making it entirely bug free. Time to time, the worker threads will crash and I have to restart the whole routine. In the process I lose all the tasks that have been queued. Is there a way to save the queue to a file so that whenever I restart the process the task list is preloaded from that file?
On first thought it seems that as I get or put tasks into the queue, I should be reading and writing to a file simultaneously. However this doesn't give me the functionality of queue.task_done() and may not be the most optimized solution. Any ideas would be greatly appreciated.