Please enable JavaScript.
Coggle requires JavaScript to display documents.
Process & Process Management (PROCESS STATES (Running, which means…
Process & Process Management
Program
sequence of instructions.
may be C source code.
After compilation, program is executable code.
Programs are stored on disk as static entities.
when a program is running:
instantiated in memory
taking up system resources such as memory for data structures, file descriptors
providing at least one thread of execution which defines the current state and subsequent required operations for the process
Processes
What is a process?
a dynamic invocation of a program along with the resources required to run.
These include user and system stacks, memory, file handles, etc.
runs in a separate address space.
used the microprocessor
use files within the file systems and may access the physical devices in the system either directly or indirectly.
How do I make one? wait for one? kill one?
Birth
Life
Death
PROCESS MANAGEMENT
Every process in a UNIX system has the following attributes:
some code( a.k.a. text )
some data
a stack
a unique process ID number(PID)
PROCESS STATES
Running
, which means that the process is currently using the CPU.
Runnable
, which means that the process can make use of the CPU as soon as it becomes available.
Sleeping
, which means that the process is waiting for an event to occur.
For example, if a process executes a “read()” system call, it sleeps until the I/O request completes.
Suspended
, which means that the process has been “frozen” by a signal such as SIGSTOP.
It will resume only when sent a SIGCONT signal.
For example, a Control-Z from the keyboard suspends all of the processes in the foreground job.
Idle
, which means that the process is being created by a “fork() system call and is not yet runnable.
Zombified
, which means that the process has terminated but has not yet returned its exit code to its parent.
A process remains a zombie until its parent accepts its return code using the “wait()” system call.
PROCESS COMPOSITION
a code area
, which contains the executable(text) portion of a process
a data area, which is used by a process to contain static data
a stack area
, which is used by a process to store temporary data
a user area
, which holds housekeeping information about a process
page tables
, which are used by the memory management system
Page Tables (OR Process Table)
contains an entry for every process in the system
created in the kernel’s region and is accessible only by the kernel
contains an entry for every process in the system
contains the following information about each process:
its process ID(PID) and parent process ID (PPID)
its real and effective user ID (UID) and group ID (GID)
its state (running, runnable, sleeping, suspended, idle, zombified)
the location of its code, data, stack, and user areas
a list of all pending signal
Process Operation
create a process
destroy a process
run a process
suspend a process
get process information
set process information
Zombie Processes
On Unix and Unix-like computer operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table.
A process that terminates cannot leave the system until its parent accepts its return code.
If its parent process is already dead, it’ll already have been adopted by the “init” process, which always accepts its childrens’ return codes.
If a process’ parent is alive, but the parent never executes a “wait()” system call, the process’ return code will never be accepted and the process will remain a zombie.
A zombie process doesn’t have any code, data, or stack, so it doesn’t use up many system resources.