3 ms·
Using multiprocessing in Python is more complicated because each process has a separate memory space and interprocess communication can be quite expensive. If
by bwood 12y ago
Using multiprocessing in Python is more complicated because each process has a separate memory space and interprocess communication can be quite expensive. If you don't carefully design your communication patterns, any performance you expect to gain by using multiple cores can easily be lost.
- influx 12y agoYou'd be mistaken to think just because you share memory space that you don't have to think about or design around the same issues with threads. The main issue I've ran into with multiprocessing is objects that are unpickleable, otherwise, it's pretty transparent usually.
- bwood 12y agoThat's interesting, what sort of communication issues have you run into with threading? I've always found it to be mostly a non-issue since you can use global variables or just pass along a reference.