We have a system that will get ported from C# to Python. My Python experience is limited to making simple tools and the more I read about multi threading, the less I’m confident the switch is a good idea.
The system is dealing with financial data, by blocks of 5 seconds, arriving in real time.
It has one main processing thread, two threads waiting for orders from the main thread and another thread listening to a socket where data is passed to the main thread, affecting its operations on the fly.
The reason for the switch is mostly for unification purpose and not based on tech considerations. In short, politics...
From what I read, Python is not truly multithreaded but can switch pseudo threads on blocking IO, which is not something making any sense in the current context.
The threads could be separated into different processes / apps but then I have to solve the communication problem and since there doesn’t seem to be true threading solution, I can’t have a thread listening to messages while the other one does the work; polling doesn’t really make sense.
So, is my understanding of Python’s abilities correct? Or have things improved compared to what I am reading, which is very messy; I haven’t found a good authority that says “you can do x, you can’t do y” and most of the web post seem so ecstatic about Python that no one seems to be going in depth about things it may not be able to do.
So, to narrow down my question: can I create true threads and use non polling mechanisms to pass messages, like a thread waking up on a socket message, etc in Python? (Doing it in C# is trivial so I’m guessing there has to be some way)