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 ?

A

Thread ID

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
Q

Command to terminate a process ?

A

kill -SIGKILL
or
kill -9

26
Q

How to kill processes of another user ?

A

You can’t, or must be root

27
Q

RUID is ?

A

Real User ID : ID assigned to user who starts a process.

28
Q

EUID is ?

A

Effective User ID: ID assigned to user who determines access rights to other users. May or may not be the same as RUID.

29
Q

RGID ?

A

Real Group ID: ID assigned to a group.

30
Q

EGID ?

A

Effective Group ID: ID assigned to group who determines the access rights of other groups.

31
Q

How many task at a time can a CPU handle ?

A

One.

32
Q

A nice value is ?

A

The priority of a process.

33
Q

Higher priority has higher/lower nice value ?

A

Lower.

34
Q

Load average is ?

A

The average of the load number for a given period of time.

35
Q

Command line to view the “load average” ?

A

w, uptime or top

36
Q

Interpret this load average ?

0.45, 0.17, and 0.12

A
  1. 45: For the last minute the system has been 45% utilized on average.
  2. 17: For the last 5 minutes utilization has been 17%.
  3. 12: For the last 15 minutes utilization has been 12%.
37
Q

Load average of 1.00 means ?

A

CPU is utilized 100%

38
Q

Load average of > 1.00 means ?

A

CPU is over-utilized

39
Q

If there is a quad-CPU system, a load average of 4.00 means ?

A

CPU is utilized 100%

40
Q

Foreground jobs are ?

A

Commands run directly from the shell. When foreground jobs are running, other jobs must wait to access to the shell.

41
Q

If the job takes long time to complete, what can be done so that other jobs can access to the shell ?

A

Run the job in background and free the shell for other tasks.

42
Q

Command to list the jobs running in the background ?

A

jobs -l

43
Q

To make a job run in the background, add ?

A

&

sleep 100 &

44
Q

To view currently running processes ?

A

ps

45
Q

To display information of processes for a specified username ?

A

ps -u

46
Q

To display all processes of the system in full detail ?

A

ps -ef

47
Q

To display processes running on the system in tree form ?

A

pstree

48
Q

To display system performance live overtime ?

A

top

49
Q

Nice value or Niceness is written as ?

A

ni

50
Q

Swap space is ?

A

Temporary storage space on a hard drive.

51
Q

Utility program to schedule non-interactive command at a specified time in the future.

A

at

at now + 2 days

52
Q

Utility program to schedule a job on an on-going basis.

A

cron

crontab -e

53
Q

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.

A

sleep

54
Q

To see the queue of pending jobs

A

atq