Seems more cumbersome. Any noticeable advantage to that than, say, having some private/protected properties for the thread to access that are stand-ins for parameter passing? Granted I know this can lead to similar results as if I were passing a parameter by reference.
I suppose it’s just how deeply I want to encapsulate.
The advantage would be encapsulation, which would allow you to have more than one such thread running at a time. You shouldn’t share global variables between threads.
In this particular instance it’s already encapsulated by a class, so all the parameters are private, but I understand what you mean.
I basically have a class with one method I can call from the main thread and then it creates threads on the fly to read a gzipped file, process it, and rezip it. The thread is assigned to each of the three functions serially so 1) keeps the UI responsive and 2) it can report a state (running/not running) for each section of functionality. No need for another level of encapsulation as I don’t see any access conflicts.