I've read through the documentation on threading for python and as I've pereceived it the following should hold true: You can access (read) any PoD or python specific object (such as an array) without causing failure in a multi-threaded program trying the same thing at the same time, but you can not change them and accept thread integrity.
My question is about classes. I have a server that is delegating database access to different threads, however I want them to be able to all access an instance of a class that handles response generation. However, I'm wondering if this class is thread-safe (I wish to avoid creating multiple instances), the thread does not change any instance variables (i.e. self.something = (something)
) every function uses its own local variables (they do access class instance variables but does not change them), so to sum it up: my question is if many threads can use the same instance and call functions at the same time.