I'd suggest setting a breakpoint in callp() on the dMY_CXT line - so it stops just after dTHX has been executed. Then print out the value of my_perl at that point. I suspect on the first call it will be same as that passed to other functions, e.g. the
XS_MPV__Simple__xs_set_wakeup_callback (my_perl=0x555555953260, ...)
from your example above. I also suspect that on the second call it will be NULL (or at least not the same as the first call). If so it will confirm my diagnosis.
You'll need to explain to me how these extra threads are created and what they do, and what happens to the main perl thread while the callback is taking place - is it suspended, or is it off busily doing its own thing?