[HN Gopher] Python Concurrency: The Tricky Bits
___________________________________________________________________
Python Concurrency: The Tricky Bits
Author : rbanffy
Score : 21 points
Date : 2021-02-17 13:51 UTC (7 hours ago)
(HTM) web link (python.hamel.dev)
(TXT) w3m dump (python.hamel.dev)
| pybo wrote:
| Anyone using Dask (dask.org)?
| tasubotadas wrote:
| Tricky bits? Thanks to GIL, it's just broken and doesn't work.
| sleepysysadmin wrote:
| Threading is nice until you learn about the global interpreter
| lock. Then you go multiprocessing for everything.
| dvfjsdhgfv wrote:
| OK, let's get things more straight:
|
| * Threads are useful not just for speeding up, but also for
| parallel execution (storege/network io, graphics, ...)
|
| * If you really care about speed and would like to parallelize
| CPU-bound code, you'll probably do better using another
| language like C/C++ (or Java, Go, D etc.) for this particular
| task
|
| * In general, threads are used instead of processes because of
| the overhead involved in creating the latter
|
| * Python multiprocessing module isn't the most efficient
| anyway, for example when passing large objects between
| processes because of the way they're serialized
|
| * It also has some other quirks so I would definitely not
| advise to use it for "everything".
___________________________________________________________________
(page generated 2021-02-17 21:02 UTC)