Beruflich Dokumente
Kultur Dokumente
401-BSCS-14 Assignment 3 ( Q2 )
Section E-1 Dr. Awais Qasim
-------------------------------------------------------------------------------------------------------------------
Process Control Block
Process Control Block, also known as Task Control Block is the structure defined in sched.h file located at
/usr/src/linux-headers-4.8.0-49/include/linux/, by the name of task_struct. This structure has everything that a
process need for its execution. Let’s have look at few of the elements defined in the structure.
- int static_priority
This integer variable is used to store the priority which is allocated to the process when it is
created.
- int normal_priority
This normal priority stores the value of priority calculated from static_priority and the priority
which is assigned to the process by scheduling algorithm.
- int prio
This is value of priority which is given to the process by the scheduling algorithm/policy
currently in use.
- unsigned int policy
The scheduling policy used by the kernel for this process.
- pid_t pid
Process Identifier of the process assigned by kernel.
- pid_t tgid
Process Identifier of the group leader of the current process if it is working as a thread.
- cpumask_t cpus_allowed
This defines the number of processes which process can access and use.
-----------------------------------------------------------------------------------------