Open christianbrugger opened 9 years ago
We'll need to add explicit shutdown functions to all our classes that create such objects and make sure to call them throughout the hierarchy. Kind of a pita but without RAII there's not much you can do to work around this. We'll probably want to move the creation of these queues out of the controller somewhere that already deals with application lifetime. We'll need that later anyways so we can actually use multiple processes. It'll probably end up - in wrapped form - where we currently setup the backend/shutdown stuff.
Beyond precisely controlling the life-time what we can also investigate is why exactly they aren't joined on shutdown. I'd assume python guarantees us to call __del__
on them during shutdown so the issue is probably that they don't force a join there. If that is the case adding that on the queue itself might be enough to resolve the issue.
Currently in many tests there are unjoined threads, after running the tests. Many of them are
QueueFeederThread
that are part of themultiprocessing.Queue
implementation. I suggest we close them somewhere with:@hacst what would be the best place to close these threads?
Currently more than 30 unittests fail because of this issue. To enables detection of unjoined thread remove the line: https://github.com/LogikSim/LogikSim/blob/master/src/tests/helpers.py#L164