vmprof-python icon indicating copy to clipboard operation
vmprof-python copied to clipboard

`{start,stop}_sampling` has a different semantics in unix and windows

Open antocuni opened this issue 8 years ago • 2 comments

I just noticed by looking at the implementation: on unix, we use a counter, while on windows it's a simple boolean. This means that this code behave differently:

_vmprof.stop_sampling()
_vmprof.stop_sampling()
_vmprof.start_sampling()

on widows, it will restart to take samples, while on unix it won't. I propose to tweak the windows implementation to behave like the unix one, to prevent subtle bugs and/or different behaviors.

antocuni avatar Nov 29 '17 10:11 antocuni

Yep, I agree. Specifically this is about vmprof_ignore_signals which behaves differently. The reason for being a counter on linux is because of the CAS (compare and swap) operations supported by gcc. MVSC supports those?

planrich avatar Nov 29 '17 12:11 planrich

yes, it seems so: https://msdn.microsoft.com/en-us/library/windows/desktop/ms683560(v=vs.85).aspx

antocuni avatar Nov 29 '17 15:11 antocuni