Processes Flashcards
A process is ?
An instance of one or more related tasks (threads) executing on your computer.
A Process is different from a Command in ?
A command may actually start several processes simultaneously.
Example of some process types ?
\+ Interactive processes \+ Batch processes \+ Daemons \+ Threads \+ Kernel threads
Interactive processes are ?
Processes started by a user, either at a command line or through a graphical interface such as an icon or a menu selection.
Examples of interactive processes ?
bash, firefox, top
Batch processes are ?
Automatic processes which are scheduled from and then disconnected from the terminal. These tasks are queued and work on a FIFO (First-In, First-Out) basis.
Examples of batch processes ?
updatedb, ldconfig
Daemons are ?
Server processes that run continuously. Many are launched during system startup and then wait for a user or system request indicating that their service is required.
Examples of daemons ?
httpd, sshd, libvirtd
Threads are ?
Lightweight processes. These are tasks that run under the umbrella of a main process, sharing memory and other resources, but are scheduled and run by the system on an individual basis. An individual thread can end without terminating the whole process and a process can create new threads at any time. Many non-trivial programs are multi-threaded.
Examples of threads ?
firefox, gnome-terminal-server
Kernel threads are ?
Kernel tasks that users neither start nor terminate and have little control over. These may perform actions like moving a thread from one CPU to another, or making sure input/output operations to disk are completed.
Examples of kernel threads ?
kthreadd, migration, ksoftirq
A scheduler is ?
A kernel function that constantly shifts processes on and off CPU, sharing time according to relative priority, how much time is needed and how much has been granted to a task.
What does a process in a running-state do ?
That process is currently executing instructions on a CPU, or is waiting to be granted a share of time so it can executes.
What does a process in a sleep-state do ?
That process is waiting for something to happen before it can resume (eg. for the user to type something).
The process is sitting on a wait queue.
What does it mean if a process is in a zombie-state ?
In general, there are parent processes and child processes. Sometimes, when a child process completes, but its parent process has not asked about its state yet. Such a child process is said to be in a zombie-state. It is not really alive but still shows up in the system’s list of processes.
How the OS keeps track of a process ?
By giving it a unique process ID number (PID).
What does a PID track ?
\+ Process state \+ CPU usage \+ Memory usage \+ Location of resource in memory \+ Others
What does PID 1 denote ?
init process
What does PPID stand for ?
Parent Process ID