News for hackers. Stuff that matters.
Re:The multiprocessing module in Python by dom0 on Friday February 03, 2017 @02:24PM (#13562453)
You can of course use multithreading to get parallelism, eg. if the expensive calculations are not done in Python itself but rather some other library, be it cryptography, compression, numpy, serdes'ing stuff and so on. I/O works in parallel as well.
Re:The multiprocessing module in Python by jMyles on Friday February 03, 2017 @06:15PM (#13564202)
I wish I had a thousand upvotes to give this comment. This is the single most misunderstood concept in async python. I started and still contribute to hendrix (a "Twisted Django") and I can't believe how bright a lightbulb this is for people when they realize it.
Re:The multiprocessing module in Python by ddorian43 on Friday February 03, 2017 @04:55PM (#13563675)
It's still 1 core for multithreading (on the python part).
Re:The multiprocessing module in Python by gshulegaard on Friday February 03, 2017 @07:20PM (#13564635)
Just to add more context for others...

C extensions called from Python are still subject to the GIL of the calling interpreter[1].

In fact, this guaranteed thread safety has led to the creation of many non-thread safe Python C extensions which is now a critical blocker to efforts to removing the GIL[2], although there are also a number of other issues as well.

As noted in the StackOverflow, you can release the GIL but there are some tricks to doing so safely[3].

But threads of a C extensions library are not necessarily pinned to a single core by the GIL like regular Python byte code.

Although many performance oriented libraries like numpy[4] forsake multi-threading by default in many cases and rely on parallelization by the user (programmer)[5].

[1] http://stackoverflow.com/questions/651048/concurrency-are-py...

[2] https://youtu.be/P3AyI_u66Bw

[3] https://docs.python.org/3/c-api/init.html#thread-state-and-t...

[4] http://www.numpy.org/

[5] http://stackoverflow.com/questions/16617973/why-isnt-numpy-m...