mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-131253: free-threaded build support for pystats (gh-137189)
Allow the --enable-pystats build option to be used with free-threading. The stats are now stored on a per-interpreter basis, rather than process global. For free-threaded builds, the stats structure is allocated per-thread and then periodically merged into the per-interpreter stats structure (on thread exit or when the reporting function is called). Most of the pystats related code has be moved into the file Python/pystats.c.
This commit is contained in:
parent
cf1a2c1ee4
commit
c98c5b3449
24 changed files with 1269 additions and 485 deletions
|
|
@ -36,6 +36,7 @@
|
|||
#include "pycore_pystate.h" // _PyThreadState_GET()
|
||||
#include "pycore_qsbr.h"
|
||||
#include "pycore_tstate.h" // _PyThreadStateImpl
|
||||
#include "pycore_stats.h" // FT_STAT_QSBR_POLL_INC()
|
||||
|
||||
|
||||
// Starting size of the array of qsbr thread states
|
||||
|
|
@ -158,7 +159,7 @@ _Py_qsbr_poll(struct _qsbr_thread_state *qsbr, uint64_t goal)
|
|||
if (_Py_qbsr_goal_reached(qsbr, goal)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
FT_STAT_QSBR_POLL_INC();
|
||||
uint64_t rd_seq = qsbr_poll_scan(qsbr->shared);
|
||||
return QSBR_LEQ(goal, rd_seq);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue