A thread can be said as the smallest entity of a process that is scheduled to be executed by an operating system. Since the processor can execute only instructions, a multi-tasking operating system splits a long process into small unit called threads. These threads are scheduled to execute for 10ms (For Example). These thread are given a unique identifier number called ThreadID. After the execution, the operating system saves the state of the thread executes the next thread. Some of the saved state contains CPU registers, The Kernel Space Stack and the User Space Stack, Thread Local Storage, storage area.
Some of the essential components of the thread are:
- Contnets of set of CPU registers like Accumulator, Stack pointer, Count and Data Register along with Instruction Pointer
- Kernel Mode Stack information
- User Mode Stack information
- thread-local-storage (TLS) for use by runtime libraries.
- Thread Context and Security context for storing privileges.
Comments
Leave a comment Trackback