mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
gh-115999: Disable the specializing adaptive interpreter in free-threaded builds (#116013)
For now, disable all specialization when the GIL might be disabled.
This commit is contained in:
parent
2e94a6687c
commit
339c8e1c13
9 changed files with 96 additions and 3 deletions
|
@ -296,11 +296,19 @@ GETITEM(PyObject *v, Py_ssize_t i) {
|
|||
#define ADAPTIVE_COUNTER_IS_MAX(COUNTER) \
|
||||
(((COUNTER) >> ADAPTIVE_BACKOFF_BITS) == ((1 << MAX_BACKOFF_VALUE) - 1))
|
||||
|
||||
#ifdef Py_GIL_DISABLED
|
||||
#define DECREMENT_ADAPTIVE_COUNTER(COUNTER) \
|
||||
do { \
|
||||
/* gh-115999 tracks progress on addressing this. */ \
|
||||
static_assert(0, "The specializing interpreter is not yet thread-safe"); \
|
||||
} while (0);
|
||||
#else
|
||||
#define DECREMENT_ADAPTIVE_COUNTER(COUNTER) \
|
||||
do { \
|
||||
assert(!ADAPTIVE_COUNTER_IS_ZERO((COUNTER))); \
|
||||
(COUNTER) -= (1 << ADAPTIVE_BACKOFF_BITS); \
|
||||
} while (0);
|
||||
#endif
|
||||
|
||||
#define INCREMENT_ADAPTIVE_COUNTER(COUNTER) \
|
||||
do { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue