It was a long journey, but we successfully struggled through most of the common approaches to concurrent programming that are available for Python programmers.
After explaining what concurrency really is, we jumped into action and dissected one of the typical concurrent problems with the help of multithreading. After identifying the basic deficiencies of our code and fixing them, we turned to multiprocessing to see how it would work in our case. We found that multiple processes with the
multiprocessing module are a lot easier to use than plain threads coming with the
threading module. But just after that, we realized that we can use the same API for threads too, thanks to the
multiprocessing.dummy module. So, the decision between multiprocessing and multithreading is now only a matter of which solution better suits the problem and not which solution has a better interface.
And speaking about problem fit, we finally tried asynchronous programming, which should be the...