Multiprocessing or Multithreading?

前端 未结 9 576
夕颜
夕颜 2020-12-12 16:13

I\'m making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for

9条回答
  •  醉酒成梦
    2020-12-12 17:12

    There was a good talk on multiprocessing at Pycon this year. The takeaway message was "Only use multiprocessing unless you're sure you have a problem that it will solve, that cannot be solved with threads; otherwise, use threads."

    Processes have a lot of overhead, and all data to be shared among processes must be serializable (ie pickleable).

    You can see the slides and video here: http://blip.tv/pycon-us-videos-2009-2010-2011/introduction-to-multiprocessing-in-python-1957019

    http://us.pycon.org/2009/conference/schedule/event/31/

提交回复
热议问题