- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Process Representation in Linux System
Linux can manage the processes in the system, each process is represented by a task_struct C data structure. It is found in the <linux/sched.h> include file in the kernel source-code directory. The task vector is an array of pointers to every task_struct data structure in the system. As well as the normal type of process, Linux supports real time processes. All the required information i.e; the state of the process, scheduling and memory-management information, list of open files, and pointers to the process’s parent and a list of its children and siblings are contained in this structure.
A process who creates a process is called parent of that created process; its children are any processes that it creates and siblings are children with the same parent process.
Some of these fields include −
long state; /*denote state of the process */ struct sched entity se; /*denote scheduling information */ struct task struct *parent; /*denotes this process’s parent */ struct list head children; /*denotes this process’s children */ struct files struct *files; /* denotes list of open files */ struct mm struct *mm; /* denotes address space of this process */ struct task struct *p_opptr,*p_pptr,*p_cptr,*p_ysptr,*p_osptr /*denotes, op = original parent, p = parent, c = youngest child, ys = youngest sibling, os = older sibling */
All active processes are represented using a doubly linked list of task struct, within the Linux kernel. A pointer is maintained by Kernel –current-to the process currently executing on the system, as shown below −
E.g. If the system would like to change the state of the process currently running to the value new state. If current is a pointer to the process currently executing, its state is changed with the following: current->state = new state;
- Linux Process Monitoring
- Process Synchronization in Linux
- Process Creation vs Process Termination in Operating System
- Process Deadlocks in Operating System
- Process Communication in Operating System
- What is Zombie Process in Linux?
- How to create a process in Linux?
- Init process on UNIX and Linux systems
- What is a process in Operating System?
- Prevent fork bomb by limiting user process in linux
- How to Kill a Process by Name in Linux?
- What are the process states in Windows and Linux?
- What are the Process Management System Calls?
- How to flushes file system buffers in the Linux operating system?
- Count the number of threads in a process on linux