[issue27483] Expose HEAD_LOCK/HEAD_UNLOCK in pystate.c

2016-07-11 Thread Maciej Fijalkowski
Maciej Fijalkowski added the comment: On windows the profiler runs in a separate thread and pauses/restarts other threads (hence the requirements are slightly different). HEAD_LOCK etc. are def not async-signal safe, but it's not an issue on linux --

[issue27483] Expose HEAD_LOCK/HEAD_UNLOCK in pystate.c

2016-07-11 Thread STINNER Victor
STINNER Victor added the comment: Is the profiler running in the same process than the profiled application? Vmprof uses a signal handler, right? HEAD_LOCK is a mutex, acquire a mutex is not async-signal safe :-( Is it an issue? -- ___ Python

[issue27483] Expose HEAD_LOCK/HEAD_UNLOCK in pystate.c

2016-07-11 Thread Maciej Fijalkowski
New submission from Maciej Fijalkowski: Hi The use case here is for C-based statistical profilers. When running vmprof on linux/os x, you can get the current thread state from PyThreadState_GetUnchecked or a similar solution. However, on windows you need to walk all the interpreter state,