I'm using the threading module in Python and have read the tutorial here. My intended program flow is that I have 2 functions foo() and bar() and the following happens
1) foo() runs and collects some data stored in data then stops.
2) bar() then runs continuously using data.
3) After 2 minutes foo() runs again and updates data while bar() continues to run using the old version of data.
4) After the successful update bar() starts using the new version of data.
5) Loop back to (3)
Now I want to run these as separate threads and my issue lies in how does foo() tell bar() it has finished running and the new version of data is available?
I've read about Queue but couldn't see exactly how I would use it in this instance.
baruse the data? Does it keep using it over and over, or just once? If just once, then either theQueueorPipewill work.