开发者

High multi-threading using Python

开发者 https://www.devze.com 2023-02-20 21:53 出处:网络
I want to running large-scale mathematical operations using Python multi-threading; I need software for many computer to do this. What is the best way?

I want to running large-scale mathematical operations using Python multi-threading; I need software for many computer to do this. What is the best way?

Thanks.

This is my idea:

  1. use c to开发者_如何转开发 handle the core code of python
  2. setup a software to handle the multi-threading
  3. and so on


You should check this Post regarding parallel and cluster computing, as for using c check Cython


Python threads are good for IO bound loads, but CPU bound loads end up fighting over processor time as the global interpreter lock forces all threads to execute one at a time even on a multi core machine. You would be better looking at the multiprocessing module and deploying as many processes as you need and have them talk with pipes or sockets(if you are using a cluster).


IPython has a module for parallel computing that sounds like it would fit the bill.

0

精彩评论

暂无评论...
验证码 换一张
取 消