Skip to content

Posts tagged ‘work’

7
Oct

threading.Thread vs. multiprocessing.Process

The Feather or the Anvil?  


First a bit of background: I was tasked with created a high level tester for my company’s system. The idea is create 1 or more monkeys to pound away at the company’s product for a very long time. A concurrent parallel programming project with the requirement that it needed to be compatible with 2.6.2 version of Python.

With threading, you get real posix threads (pthread) which works pretty well. They implicitly share state with the parent thread and do not use IPC or messaging. They have low latency and low overall resource footprint.

However there are drawbacks that made further development using threads a real problem. that is the use of signals. Such as threads not handling signals, working with the global interpreter lock (GIL, only one thread allowed to run at a time), and more. Read moreRead more