This is what I have understand so far...
- Every process has its own kernel stack(space)
- Thread has independent stack memory and share the other (heap code etc...)
- What are inside in the Kernel stack is some formal information for its process' later context switch
Here is the part where I get confused....
If Thread only has its own stack memory, how does OS can manage thread's context switch? If process A has 10 threads, all those threads' information is written in process A's kernel space? wouldn't be cause a lack of memory in kernel space when there are too many threads?
Please let me know what I am missing here.
Thanks.