I read the documentation on streaming processing for python, and as I understand it, this should be true: you can access (read) any specific PoD or python object (e.g. an array) without causing a crash in a multi-threaded program trying to execute one at a time and the same, but you cannot change them and accept the integrity of the flow.
My question is about classes. I have a server that delegates access to databases for different threads, however I want them to be able to access an instance of the class that handles the response generation. However, I am wondering if this class is thread safe (I want to avoid creating multiple instances), the thread does not change any instance variables (i.e. self.something = (something)), each function uses its own local variables (they have an instance of the access class variables, but donβt change them), so to summarize: my question is that many threads can use the same instance and call functions at the same time.
source
share