[issue35276] Document thread safety

2021-09-21 Thread STINNER Victor
STINNER Victor added the comment: It would be nice to document thread safety, but it's a large project. Maybe the Documentation Working Group could look into this issue. But nobody managed to write the doc in 3 years, I prefer to close the issue. -- resolution: -> rejected stage: -

[issue35276] Document thread safety

2020-08-24 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- nosy: +sir-sigurd ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue35276] Document thread safety

2018-12-17 Thread STINNER Victor
STINNER Victor added the comment: About system-wide: see also PR 11190, "time.monotonic() is now always available and always system-wide." -- ___ Python tracker ___ _

[issue35276] Document thread safety

2018-11-20 Thread STINNER Victor
STINNER Victor added the comment: Aha, another strange beast: in Python 3, locale.localeconv() now changes temporarily the LC_CTYPE locale is some cases, and this change affects other threads. That's not something expected. -- ___ Python tracker

[issue35276] Document thread safety

2018-11-20 Thread STINNER Victor
STINNER Victor added the comment: I don't think that it would make sense to annotate *each* function in the documentation, that would require too much work. I suggest to start to annotate functions which are known to have "side effects" or are not safe whereas users can be surprised to read

[issue35276] Document thread safety

2018-11-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: One idea is that you could author a threading HOWTO document that covers atomicity, locks, queues, reentrancy, etc. This is a thorny topic and it would be nice to have the principles and techniques collected in one place. Ideally, it would include exampl

[issue35276] Document thread safety

2018-11-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: The general rule in Python is that nothing can be considered atomic unless specifically documented as atomic (such as the queue module or lru_cache which have internal locks). The only safe action is to put locks around all accesses to shared resources.

[issue35276] Document thread safety

2018-11-19 Thread STINNER Victor
STINNER Victor added the comment: "Proces-wide" vs "thread-safe" is one thing. Another interesting property is "reentrant", but maybe that's too wide? Somehow related, iterating on a container and modify it may or may not work depending on the container type and the kind of modifications. -

[issue35276] Document thread safety

2018-11-19 Thread STINNER Victor
New submission from STINNER Victor : Many developers only discover that a Python function/module is not thread safe because they have a bug in production... Some examples: * bpo-7672: ssl * bpo-8865: select.poll is not thread safe * bpo-539175, bpo-21216: socket.gethostbyname() * bpo-7980: ti