4 ms·
Of course Java has thread safe collections in the standard library. ConcurrentHashMap etc. are popular in multithreaded contexts.
by wtetzner 3y ago
Of 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.