Kernel? WTF? Why kernel should know or even care? Kernel runs two (or more) processes with a shared address space, what happens inside of these two processes is entirely up to userspace.
Even clone(2) syscall which creates such processes does not know anything about threads: it just returns different return values in different processes but it does not change %xSP, it does not allocate new stack, etc.
Sorry, but you are barking on the wrong tree.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds