Os 2 Flashcards

1
Q

What is a process?

A

A process is a program in execution, consisting of the program code and its current activity (e.g., program counter, registers, variables).

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

How is a program different from a process?

A

A program is a passive collection of instructions; a process is an active execution of those instructions, including state information.

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

What are the main components of a process?

A
  1. Code (text section), 2. Data section, 3. Stack, 4. Heap, 5. Program Counter, 6. CPU Registers.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What information does the Process Control Block (PCB) contain?

A

Process state, process ID, CPU registers, CPU scheduling info, memory management info, accounting info, and I/O status info.

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

What are the possible states of a process?

A

New, Ready, Running, Waiting, Terminated.

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

What happens during process creation?

A

The OS assigns a unique ID, allocates resources, loads the program into memory, and initializes the PCB.

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

What is process termination?

A

It is when a process finishes execution and releases all allocated resources, and the PCB is deleted from the process table.

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

What is a parent and child process relationship?

A

A parent creates child processes, which can then create their own processes, forming a process tree.

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

What is the fork() system call used for?

A

In UNIX systems, fork() creates a new child process that is a duplicate of the parent process.

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

What is the exec() system call used for?

A

It loads a new program into a process’s memory space, replacing the old program while keeping the same process ID.

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

What is the wait() system call used for?

A

It makes the parent process wait until a child process terminates, allowing orderly process cleanup.

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

Why are process identifiers (PIDs) important?

A

PIDs uniquely identify active processes, allowing the OS to track and manage them.

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

What is process scheduling?

A

The decision of which process to run next when the CPU becomes idle, based on scheduling algorithms.

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

What is the short-term scheduler?

A

Also known as the CPU scheduler, it selects from ready processes and allocates the CPU to one of them.

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

What is the long-term scheduler?

A

It decides which processes should be admitted into the ready queue from the job pool, controlling the degree of multiprogramming.

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

What is the medium-term scheduler?

A

It suspends and resumes processes to manage memory load and improve performance.

17
Q

What is context switching?

A

Saving the state of the currently running process and loading the state of the next scheduled process.

18
Q

Why is context switching considered overhead?

A

Because no useful work is done during switching, but it is necessary to allow multitasking.

19
Q

What is a process queue?

A

A linked list of PCBs representing processes in a specific state (e.g., ready queue, I/O queue).

20
Q

What are the types of queues used in process scheduling?

A
  1. Job queue, 2. Ready queue, 3. Device queues.
21
Q

What are the different types of schedulers?

A

Long-term, short-term, and medium-term schedulers, each managing processes at different stages.

22
Q

What is the difference between I/O-bound and CPU-bound processes?

A

I/O-bound processes spend more time doing I/O than computations; CPU-bound processes spend more time doing computations than I/O.