[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2021-06-29 Thread h-vetinari
Change by h-vetinari : -- nosy: +h-vetinari ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2021-02-19 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +23375 pull_request: https://github.com/python/cpython/pull/24597 ___ Python tracker ___

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2021-02-19 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +23374 pull_request: https://github.com/python/cpython/pull/24596 ___ Python tracker ___

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2021-02-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset 62078101ea1be5d2fc472a3f0d9d135e0bd5cd38 by Victor Stinner in branch 'master': bpo-40522: Replace PyThreadState_GET() with PyThreadState_Get() (GH-24575) https://github.com/python/cpython/commit/62078101ea1be5d2fc472a3f0d9d135e0bd5cd38

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2021-02-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23354 pull_request: https://github.com/python/cpython/pull/24575 ___ Python tracker ___

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-30 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-30 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-30 Thread STINNER Victor
STINNER Victor added the comment: One GIL per interpreter requires to store the tstate per thread. I don't see any other option. We need to replace the global _PyRuntime atomic variable with a TLS variable. I'm trying to reduce the overhead, but it's heard to beat the performance of an

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > An optimized Python should always be built with LTO. In MacOS is quite challenging to activate LTO, so normally optimized builds are only done with PGO. Also in Windows I am not sure is possible to use LTO. Same for many other platforms --

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: Mark Shannon experiment using __thread: * https://mail.python.org/archives/list/python-...@python.org/thread/RPSTDB6AEMIACJFZKCKIRFTVLAJQLAS2/ * https://github.com/python/cpython/compare/master...markshannon:threadstate_in_tls He added " extern __thread

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: PR 23976 should make _PyInterpreterState_GET() more efficient, and it prepares the code base for one GIL per interpreter (which is purpose of this issue ;-)). -- ___ Python tracker

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: PR 23976 stores the currrent interpreter and the current Python thread state into a Thread Local Storage (TLS) using GCC/clang __thread keyword. On x86-64 using LTO and GCC -O3, _PyThreadState_GET() and _PyInterpreterState_GET() become a single MOV.

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22821 pull_request: https://github.com/python/cpython/pull/23976 ___ Python tracker ___

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: >_PyInterpreterState_GET(): > movrax,QWORD PTR [rip+0x22a7dd]# 0x743118 <_PyRuntime+568> > movrax,QWORD PTR [rax+0x10] While working on bpo-39465, I wrote PR 20767 to optimize _PyInterpreterState_GET(): single instruction instead of two:

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: There are many ways to get the current interpreter (interp) and the current Python thread state (tstate). Public C API, opaque function call: * PyInterpreterState_Get() (new in Python 3.9) * PyThreadState_Get() Internal C API, static inline functions: *

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-11-05 Thread Sebastian Berg
Change by Sebastian Berg : -- nosy: +seberg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-11-04 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-15751: "Make the PyGILState API compatible with subinterpreters". -- ___ Python tracker ___

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-05-14 Thread STINNER Victor
Change by STINNER Victor : -- components: +Subinterpreters -Interpreter Core title: Subinterpreters: get the current Python interpreter state from Thread Local Storage (autoTSSkey) -> [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

[issue40522] Subinterpreters: get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-05-05 Thread STINNER Victor
STINNER Victor added the comment: New changeset e838a9324c1719bb917ca81ede8d766b5cb551f4 by Victor Stinner in branch 'master': bpo-40522: _PyThreadState_Swap() sets autoTSSkey (GH-19939) https://github.com/python/cpython/commit/e838a9324c1719bb917ca81ede8d766b5cb551f4 --

[issue40522] Subinterpreters: get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-05-05 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +19254 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19939 ___ Python tracker ___

[issue40522] Subinterpreters: get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-05-05 Thread STINNER Victor
New submission from STINNER Victor : _PyThreadState_GET() gets the current Python thread state from _PyRuntime.gilstate.tstate_current atomic variable. When I experimented per-interpreter GIL (bpo-40512), I got issues with _PyThreadState_GET() which didn't return the expected Python thread