3 ms·
That's not quite true. For example, most operations on lists and dicts are thread-safe in the current version of python. You can't say that about languages with
by dpedu 3y ago
That's not quite true. For example, most operations on lists and dicts are thread-safe in the current version of python. You can't say that about languages with true multithreading.
- wtetzner 3y agoOf course Java has thread safe collections in the standard library. ConcurrentHashMap etc. are popular in multithreaded contexts.
- dpedu 3y agoThe difference is that it's a language feature in python whereas the java equivalents had to be written with locking or other approaches for handling concurrent access.
- wtetzner 3y agoIt's not a language feature in Python though. The GIL doesn't automatically make code thread safe.
- lmm 3y agoIt does, but you have to opt into them.