+---------- On Feb 12, Jerry Asher said: > At any rate, I had thought we were talking about, for the most part, > rare occasions when new threads are created.
I thought we were talking about checking SP every time something (like a stack frame) is pushed onto the stack. That means you have to know the limit for SP every time you push a stack frame. The limit depends on which stack you're using, which in turn depends on which thread is executing. So you can either store the limits in TLS, or in a global table which you search using the current SP as the key.
