What is the Difference B/W TCB(Thread control block) & PCB(Process)

A process control block (PCB) and a Thread Control Block (TCB) are both used in linux kernels to have time on the CPU delegated to them. What are the difference between the two?

What information is generally maintained in a process control bloc (PCB)?

4

3 Answers

Some notable fields that the PCB could contain are the process id, process group id, the parent process and child processes, the heap pointer, program counter, scheduling state (running, ready, blocked), permissions (what system resources the process is allowed to access), content of the general purpose registers, and open files.

TCB has a few of the same fields as the PCB (register values, stack pointer, program counter, scheduling state), in addition to a few specific values like the thread id and a pointer to the process that contains that thread. Note that there is not protection between threads.

In Linux there is a struct task_struct that stores information about a thread or process. It is declared in sched.h.

'A process control block (PCB) and a Thread Control Block (TCB) are both used in kernels to have time on the CPU delegated to them' - not normally, no. A PCB will have one or more TCB's linked to it. The TCB describes an execution context, (eg. stack pointer), the PCB an environment context, (eg. memory segments and permissions).

1

The PCB stores information about the kernel process. Like adressspaces etc...

A process can include different kernel threads. Both are managed by the dispatcher and scheduler.

The TCB includes thread specific information.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like