Processes1 Flashcards

1
Q

What is a process?

A

When a program is executed and loaded into the memory. It is an active entity. A program may create multiple almost identical processes.

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

What is a program?

A

Passive entity (executable file) stored on HDD

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

What is process context?

A

A process contains text section (program code), current activity (process number, process state, program counter, value stored in registers, CPU related information, Accounting information and I/O status information), stack (temporary data), data section (global data that is shared between processes), heap (memory allocated).

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

What is a PCB?

A

Process Control Block. Each process has its own PCB. PCB contains the context information about a process.

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

What is a process Identification Number PID?

A

Process Identifier is the unique ID number to identify a process.

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

What are the different process states?

A

A process can be in 5 possible states: new (created), running (executed), waiting, ready (waiting to be assigned to CPU) and terminated (finished).

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

What is contained in the program counter?

A

The location of instruction that CPU needs to execute next.

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

Whats an idle process?

A

Process waiting for I/O to complete

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

What is context switching?

A

When CPU is switching from Process 0 to Process 1, CPU will first save the current state/context of Process 0 to Process 0’s PCB. It will then load the state/context of Process 1 from Process 1’s PCB.

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

What is a foreground process?

A

Process that is currently visible to the user and controlled via user interface.

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

What is a background process?

A

Process that is currently running in memory but are not on display.

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

How are processes created?

A

Process is created because of an execution of a system call, initiation of a batch job, a user request to create a new process and a running process create one or more new child processes.

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

what does the fork() system call do?

A

System call to create a new process

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

What does the exec() system call do?

A

System call to load a new program to the specified process

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

What are the resource sharing options for processes?

A

A child process may share all, subset or none of the parent’s resources. Usually a child process only share subset of the parent to prevent a process overloading the system with too many child processes.

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

What are the different options for processes to exectue?

A

A child process may be executed concurrently with the parent, or the parent usually waits until the child process is terminated.

17
Q

What does the exit()system call do?

A

System call to indicate OS that the process has finished executing all of its program and OS may delete it from the RAM.

18
Q

What does the wait()system call do?

A

Parent process is waiting for child process to send its output.

19
Q

What does the abort system call do?

A

A process is terminated before it has finished executing all of its program.

20
Q

What is an abnormal termination?

A

A process is terminated abruptly before it has finished executing all of its program. This may happen due to programming error, run-time error, I/O error, parent process kills it, or user intervention.

21
Q

What is an Interrupt (Error exit)?

A

If a process is abruptly terminated because it has encountered an error that the program has anticipated. Instead of just exiting the process without any information, the process will provide user with some details about the cause of the abnormal termination and possible ways to solve the error.

22
Q

What is a fatal error?

A

If a process is abruptly terminated because it has encountered an error that the program has not anticipated. Generally, the process will exit without providing any information to user.

23
Q

How can a child process be terminated?

A

A child process may be terminated by its parent because it has exceeded its usage of some of the allocated resources, the task assigned to child is no longer required or because the parent has been terminated and the OS does not allow a child to continue.

24
Q

What is a cascading termination?

A

A child process is terminated because its parent has been terminated.

25
Q

What is a zombie process?

A

When a child process is terminated but it has no parent waiting to collect its output.

26
Q

What is an orphan process?

A

When a child process is still running even when the parent has been terminated.

27
Q

What are the different parts of a process?

A

The program code, called text section

Current activity including Program counter, processor registers

Stack containing temporary data

Data section containing global data (shared between processes)

Heap containing memory allocated during run-time

28
Q

What is the stack?

A

Used for static memory allocation
Very fast & local access (local variables), limited size
LIFO order (Last In First Out)
Automatically managed
Know exactly how much data you need to allocate before compiling

29
Q

What is the heap?

A

Used for dynamic memory allocation
Global access
Manually managed (malloc(), calloc(), free(), delete() systems calls)
Don’t know exactly how much data you need at runtime

30
Q

What info is stored in a PCB?

A

Process number and state

Program counter – location of instruction to next execute

CPU-related information

Memory-management information – memory allocated to the process

Accounting information – CPU used, clock time elapsed since start, time limits

I/O status information – I/O devices allocated to process, list of open files