Python Threading Beginners Tutorial [video]
youtube.com
youtube.com
But if you meant semantically equivalent, no they aren't - threading is shared memory and multiprocessing is message passing. If you were to draw a tree of approaches to concurrency and parallelism, you would probably make this division the root node bisecting the domain into two - it's the two fundamental approaches to doing concurrency.
Those that cross between the two are usually notable for doing that and describe themselves as a hybrid approach.
I think it divides the literature pretty cleanly in two.
In most cases, yes. You can use shared memory buffers for IPC, though, although it typically requires more effort.
Multiprocessing allows you to use all cores, but you can't share memory like in threads. So you have to Serialize/Deserialize a lot for exchange data.
If your serializations cost are low and need computation power, you should use multiprocessing. If you are just waiting I/O you can use threads.
BTW, modern python "ProcessPoolExecutor" is not designed for compute heavy batch like "Pool" from "multiprocessing".
Python can't do proper multithreading because of the GIL (excluding Jython and IronPython, of course), hence using threads in Python doesn't benefit anyone.
If you want to learn how to do multithreaded programming, pick a language where multithreading actually works - Java would be a good example. Or just take a look at a POSIX threads tutorial.
If you want to handle concurrency in Python, ignore multithreading. Take a look at the multiprocessing module, or, for a different paradigm, at asyncio or Twisted.
I never said it's wrong, it's just pointless. In Python, there's always a better alternative to multithreading which has no shortcomings.
- most if not all oss languages run on linux
- git used to be way faster for linux (may have changed since)
- programmers tend to enjoy system they can own, less the case on windows unless you work against the system (made for non tech saavy users)