4 ms·
The thread workers pool circumvent the GIL if you carefully follow some rules. I think the arguments and results need to be pickleable.
by TheCondor 8y ago
The thread workers pool circumvent the GIL if you carefully follow some rules. I think the arguments and results need to be pickleable.
- quietbritishjim 8y agoI think you're thinking of the multiprocessing module, which uses separate processes to bypass the GIL. That's why the arguments and results need to be pickleable: pickle is a serialisation procotol, so it allows you to communicate the contents of objects between different processes. If you use threads within a single process, you don't need to pickle the objects; you just pass the object directly.