Okay, great, let's now summarize our learning and findings from our preceding sample run of the countem.sh script:
- Task structures:
- Every thread alive (user or kernel) has a corresponding task structure (struct task_struct) in the kernel; this is how the kernel tracks it and all its attributes are stored here (you'll learn more in the Understanding and accessing the kernel task structure section)
- With respect to our sample run of our ch6/countem.sh script:
- As there are a total of 1,234 threads (both user and kernel) alive on the system, this implies a total of 1,234 task (metadata) structures in kernel memory (in the code, struct task_struct), of which we can say the following:
- 1,053 of these task structures represent user threads.
- The remaining 181 task structures represent kernel threads.
- Stacks:
- Every user space thread has two stacks:
- A user mode stack (is in play when the thread executes user-mode...
- Every user space thread has two stacks: