I have a Python / wxPython program where the GUI is the main stream, and I use a different stream to load data from a file. Sometimes files are large and slow to load, so I use the wxPulse dialog to indicate progress.
When I upload a file, I count the number of lines that have been read in the count stream, and I show this count in the wxPulse dialog box in the main stream. I get the score in the main thread by reading the same variable that is written by the load stream.
Is it "thread safe"? Could this somehow cause problems? I have been doing this for a while, and so far everything has been fine.
PS. I know that I can use the queue to transfer the invoice, but I am lazy and do not want it if I do not need it.
source share