[BangPypers] threading problem
abhinav.sarkar at gmail.com
Fri Mar 27 04:14:41 CET 2009
OOMMEN KM wrote:
> I am trying to write an application which reads xml messages from a
> socket, analyzes the message and sends back a resultant message.
> This should be an application in which one thread will read incoming
> xml messages and push them to a queue.
> As these messages needs to be processed independently, another set of
> threads should get the messages from the queue and process them.
> The problem I face is i get less performance rate than the one without
> Can anyone help me with some tips for making it better or things to
> remember in python threading.
> Is there any way to kill a thread explicitly.
> Thanking you in advance.
This might be due to the Global Interpreter Lock
should try using the multiprocessing module
[http://docs.python.org/library/multiprocessing.html] which uses sub
processes instead of threads. It has the same API as the threading
module so there should not be much problem in shifting your code from
threading to multiprocessing.
The world is a book, those who do not travel read only one page.
More information about the BangPypers