saagarjha 4 days ago

Suspending threads is generally not that expensive, especially if you don't do it very often. Like, it's not free, and don't do it every frame, but even if it takes even a millisecond (wildly overestimated) that's fine if you don't do it very often. Even if you're hitting a 120 Hz deadline.

1
ajkjk 3 days ago

Stack tracing, however, can be very costly. At least if you trace every thread.

(well, when I did it it was in python on python threads, which I have to assume is a lot worse. Not sure about native threads.)

saagarjha 3 days ago

It's like a hundred dereferences for native threads, that's not very much