Saturday 8 August 2015

Linux Process Management

Process Descriptors:
• The kernel maintains info about each process in a 
• process descriptor, of type task_struct. 
• See include/linux/sched.h 
• Each process descriptor contains info such as run-state of process, address space, list of open files, process priority etc...
Content of Process Descriptors:
struct task_struct 
{ 
volatile long state; /* -1unrunnable, 0runnable, >0 stopped */ 
unsigned long flags; /* per process flags */ 
mm_segment_t addr_limit; /* thread address space: 0-0xBFFFFFFF for user-thread 
0-0xFFFFFFFF for kernel-thread */ 
struct exec_domain *exec_domain; 
long need_resched; 
long counter; 
long priority; 
/* SMP and runqueue state */ 
struct task_struct *next_task, *prev_task; 
struct task_struct *next_run, *prev_run; 
... 
/* task state */ 
/* limits */ 
/* file system info */ 
/*ipc stuff */ 
/*tss for this task */ 
/*filesystem information */ 
/* open file information */ 
/* memory management info */ 
/* signal handlers */
... 
}
Process State:
Consists of an array of mutually exclusive flags* 
*at least true for 2.2.x kernels.....
Look more at below link......
http://www.epistemesoft.com/Ariticle%20more.aspx…

No comments:

Post a Comment