Please note that different threads from the same process share their memory, e.g. when you access self.status
, you (probably) manipulate an object shared within the whole process. Thus, even if your threads are killed when finishing continuesread
(what they probably are), the manipulated object's state will still remain the same.
You could either
- hold the status in a local variable instead of an attribute of self,
- initialize those attributes when entering
readalways
, - or save this state in local storage of an thread object, which is not shared (see documentation).
The first one seems to be the best as far as I can see.