Process Management Flashcards

1
Q

What is a process?

A

Process is a running program.

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

What does process include?

A

Binary, instance of VM, open files, one or more threads, associated user …

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

What is a thread?

A

Thread is a unit of activity inside a process.

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

What does each thread have?

A

Its own stack, registers and instruction pointer.

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

How do we call a unique value assigned to each process?

A

Process id.

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

What is the first process started after booting?

A

The init process.

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

What is the pid of init process?

A

1.

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

What are some of the prefered locations of init process?

A

/sbin/init, /bin/init, /etc/init

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

How does the kernel behave if it can not find the init process?

A

It halts the system.

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

What is the default maximum value that can be assigned as process id?

A

32768.

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

How can we change the default maximum value for process id?

A

By modifying /proc/sys/kernel/pid_max.

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

How does kernel allocate process ids?

A

In a linear fashion.

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

What is a parent process?

A

A process that starts a new process.

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

What is a child process?

A

Process spawned by some parent process.

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

What does child inherit from parent in terms of resource management?

A

Parents user and group ownerships.

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

What are the two steps to run a new process programatically?

A

Call to fork() followed by one of exec* calls to load the new binary.

17
Q

What does exec* function do?

A

Loads a binary image into memory by replacing currently loaded image of the running process.

18
Q

In a function execvp, what does v and p represent?

A

V denotes that a function accepts an array of arguments while p denotes that “file” argument is part of user path.

19
Q

How does exec behave on failure?

A

It returns -1 and sets an errno.

20
Q

What does fork do?

A

Creates a new process as a near duplicate of its parent.

21
Q

What does fork return to the child process?

A

0.

22
Q

What does fork return to parent process?

A

Pid of the child process.

23
Q

What is mean by copy-on-write (COW)?

A

Instead of duplicating parent resources to child process, both processes share the same resources until the moment one of the process tries to modify the resources. On first modification the process is given a resource duplicate.

24
Q

What is a zombie process?

A

Zombie is a process which is no longer running but can be found in a process table because the parent is waiting for the result of its execution.

25
Q

What is an orphan process?

A

Process whos parent is no longer running.