Linux System Programming Fundamentals

Program: compiled binary files on disk, not take up system resources (CPU, memory, devices, open files, locks, etc.)
process: the principles of operating systems are closely connected, the process is the active program or programs that are running , system resources, execute in memory

Program is a script, the process is drama

1.PCB task_struct structure of
(1) pid_t type pid
state (2) Process: ready state, running state, suspended state, terminating states
need to store and respond to at (3) the process of switching some of the contents of the register
(4) description of virtual address space
(5) of the current working directory location
(6) umask mask
(7) file descriptor table, a pointer to the file structure contains many of the body
(8) and the information related to the signal
(9) user id and set the above mentioned id
(10) session (session) and process group
resource limit (11) process can be used. ulimit -a (to view each resource capping Linux)
2. environment variables (each process has its own environment variables)
(1) extern char ** Environ (when using an environment variable must have this statement, environ ending with NULL)
(2 ) getenv () Gets the value of the environment variable
setenv () to set the environment variable value
unsetenv () delete the name of an environment variable definitions
3. the process of sharing: sharing read, write copy (copy 0-3G user space)
gdb debugging multi-process : the SET the Follow-fork-the MODE chilld
the SET the Follow-fork-parent the MODE

发布了38 篇原创文章 · 获赞 13 · 访问量 4339

Guess you like

Origin blog.csdn.net/YanWenCheng_/article/details/103929794