15 ms·
Cython lets you do `with nogil`. That said, often processes with communication are enough to leverage multi-core with no global interpreter lock (GIL). CPytho
by cb321 4y ago
Cython lets you do `with nogil`. That said, often processes with communication are enough to leverage multi-core with no global interpreter lock (GIL). CPython's pickling junk for its multiprocessing library can add a lot of overhead to that, though. A simpler pure binary version of multiprocessing could lower that overhead enough to make multiprocessing competitive with multithread unless inputs/outputs are really big (in which case tossing them in files and passing around pathnames is a not crazy fallback...). (EDIT: In the Linux kernel processes and threads are both just created by a system call named "clone" with various sharing flags. Threads are just processes with very unsafe settings - settings that many prog.langs think they can "tame well enough".)