Processes Flashcards

1
Q

A process is ?

A

An instance of one or more related tasks (threads) executing on your computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A Process is different from a Command in ?

A

A command may actually start several processes simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Example of some process types ?

A
\+ Interactive processes
\+ Batch processes 
\+ Daemons 
\+ Threads
\+ Kernel threads
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Interactive processes are ?

A

Processes started by a user, either at a command line or through a graphical interface such as an icon or a menu selection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Examples of interactive processes ?

A

bash, firefox, top

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Batch processes are ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Examples of batch processes ?

A

updatedb, ldconfig

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Daemons are ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Examples of daemons ?

A

httpd, sshd, libvirtd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Threads are ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Examples of threads ?

A

firefox, gnome-terminal-server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Kernel threads are ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Examples of kernel threads ?

A

kthreadd, migration, ksoftirq

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A scheduler is ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does a process in a running-state do ?

A

That process is currently executing instructions on a CPU, or is waiting to be granted a share of time so it can executes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does a process in a sleep-state do ?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does it mean if a process is in a zombie-state ?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How the OS keeps track of a process ?

A

By giving it a unique process ID number (PID).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does a PID track ?

A
\+ Process state
\+ CPU usage
\+ Memory usage
\+ Location of resource in memory
\+ Others
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does PID 1 denote ?

A

init process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does PPID stand for ?

A

Parent Process ID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a Parent Process ID ?

A

Process (Parent) that started this process. If the parent dies, the PPID will refer to an adoptive parent; on recent kernels, this is kthreadd which has PPID=2.

23
Q

What does TID stand for ?

24
Q

What is a Thread ID ?

A

Thread ID number. This is the same as the PID for single-threaded processes. For a multi-threaded process, each thread shares the same PID, but has a unique TID.

25
Command to terminate a process ?
kill -SIGKILL or kill -9
26
How to kill processes of another user ?
You can't, or must be root
27
RUID is ?
Real User ID : ID assigned to user who starts a process.
28
EUID is ?
Effective User ID: ID assigned to user who determines access rights to other users. May or may not be the same as RUID.
29
RGID ?
Real Group ID: ID assigned to a group.
30
EGID ?
Effective Group ID: ID assigned to group who determines the access rights of other groups.
31
How many task at a time can a CPU handle ?
One.
32
A nice value is ?
The priority of a process.
33
Higher priority has higher/lower nice value ?
Lower.
34
Load average is ?
The average of the load number for a given period of time.
35
Command line to view the "load average" ?
w, uptime or top
36
Interpret this load average ? | 0.45, 0.17, and 0.12
0. 45: For the last minute the system has been 45% utilized on average. 0. 17: For the last 5 minutes utilization has been 17%. 0. 12: For the last 15 minutes utilization has been 12%.
37
Load average of 1.00 means ?
CPU is utilized 100%
38
Load average of > 1.00 means ?
CPU is over-utilized
39
If there is a quad-CPU system, a load average of 4.00 means ?
CPU is utilized 100%
40
Foreground jobs are ?
Commands run directly from the shell. When foreground jobs are running, other jobs must wait to access to the shell.
41
If the job takes long time to complete, what can be done so that other jobs can access to the shell ?
Run the job in background and free the shell for other tasks.
42
Command to list the jobs running in the background ?
jobs -l
43
To make a job run in the background, add ?
& | sleep 100 &
44
To view currently running processes ?
ps
45
To display information of processes for a specified username ?
ps -u
46
To display all processes of the system in full detail ?
ps -ef
47
To display processes running on the system in tree form ?
pstree
48
To display system performance live overtime ?
top
49
Nice value or Niceness is written as ?
ni
50
Swap space is ?
Temporary storage space on a hard drive.
51
Utility program to schedule non-interactive command at a specified time in the future.
at | at now + 2 days
52
Utility program to schedule a job on an on-going basis.
cron | crontab -e
53
Utility program to suspend execution of a program for at least a specified period of time. After that time has passed, the execution will be resumed.
sleep
54
To see the queue of pending jobs
atq