guys!
My application is a bot. It simply receives a message, process it and returns result.
But there are a lot of messages and I’m creating separate thread for processing each, but it makes an application slower (not a bit).
So, Is it any way to reduce CPU usage by replacing threads with something else?
guys! My application is a bot. It simply receives a message, process it and
Share
You probably want processes rather than threads. Spawn processes at startup, and use Pipes to talk to them.
http://docs.python.org/dev/library/multiprocessing.html