
- Operating System Tutorial
- OS - Home
- OS - Overview
- OS - Components
- OS - Types
- OS - Services
- OS - Properties
- OS - Processes
- OS - Process Scheduling
- OS - Scheduling algorithms
- OS - Multi-threading
- OS - Memory Management
- OS - Virtual Memory
- OS - I/O Hardware
- OS - I/O Software
- OS - File System
- OS - Security
- OS - Linux
- OS - Exams Questions with Answers
- OS - Exams Questions with Answers
- Operating System Useful Resources
- OS - Quick Guide
- OS - Useful Resources
- OS - Discussion
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;
- Related Articles
- Process Synchronization in Linux
- Linux System
- Linux Process Monitoring
- Process Memory Management in Linux
- Process Creation vs Process Termination in Operating System
- Process Deadlocks in Operating System
- Process Communication in Operating System
- Linux System Call in Detail
- What is Zombie Process in Linux?
- Booting Process in DOS Operating System
- Lottery Process Scheduling in Operating System
- How to create a process in Linux?
- What is a process in Operating System?
- How to flushes file system buffers in the Linux operating system?
- How to Kill a Background Process in Linux
