Multiprocessing or Multithreading?

前端 未结 9 568
夕颜
夕颜 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:11

    With CPython multiple threads can't execute at the same time because of the GIL: link text.

    I think it's still possible that threads boost your application, e.g. a thread might block on I/O while another one does some work.

    If you've never used threads, I suggest that you try them first. It will be useful in any other language, and you'll find a lot of ressources on the web. Then if you realize that you need more parallelism, you still can switch back to processes.

提交回复
热议问题