I wrote: >>> Also the difference of time is not much... >>> How do we best optimize our task by using threads... please help...
Duncan Booth Wrote: >The only times when it may result in a decrease >in the running time... are when the time the task...when > multiple CPU's are involved. I fotgot to mention that I am running that script on a 4 node Open SSI cluster with 8 processors to do the job... > Unfortunately the latter case isn't handled well by Python Very Strange! > A good use of threads is to improve responsiveness of a system. For example > if you ensure that GUI processing happens on a separate thread from some > CPU intensive computation then you can ensure that the GUI remains > responsive while the computation is running. It won't make the computation > complete any faster (in fact it will probably be slower), but the user will > remain happier. Similarly network applications are usually multi-threaded > so that all requests get a fair chance to complete instead of having to > wait for the slowest to complete before others can run. So That means blindly using threads on any process won't help! >probably have to look at multiple processes rather than > multiple threads. How do I do that??? Does that mean forking the processes or does that mean to change the entire architecture to do small tasks in different processes??? >Alternatively you could move parts of the processing out > of the Python environment by rewriting inner loops in C Any reference/documentation for that??? Thanks and Regards Gurpreet -- http://mail.python.org/mailman/listinfo/python-list