Processes Flashcards

(15 cards)

1
Q

What is a process in an operating system?

A

A process is a program in execution where execution progresses sequentially. It includes the program (text) program counter (PC) stack and data section.

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

What are the types of programs executed by an operating system?

A

Batch system programs (jobs) and time-shared system programs (user programs or tasks).

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

List the states a process can be in during its lifecycle.

A
  1. New: The process is being created.
  2. Running: Instructions are being executed.
  3. Waiting: The process is waiting for some event to occur.
  4. Ready: The process is waiting to be assigned to a processor.
  5. Terminated: The process has finished execution.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a Process Control Block (PCB)?

A

The PCB is a kernel data structure storing information about each process including:
- Process state
- Program counter
- CPU registers
- CPU scheduling information
- Memory-management information
- Accounting information
- I/O status information

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

How is process information stored in Windows systems?

A

Using structures like the EPROCESS and PEB (Process Environment Block).

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

How is process information stored in Linux systems?

A

Linux uses the task_struct kernel structure which contains fields like: - state - stack - pid - tasks (a list of processes) This can be inspected via /proc/pid.

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

How are processes created?

A

Parent processes create children processes forming a tree of processes.
Processes are identified and managed via process identifiers (PIDs).

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

What are the resource-sharing methods in process creation?

A
  1. Parent and children share all resources.
  2. Children share a subset of the parent’s resources.
  3. Parent and children share no resources.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do parent and child processes execute in relation to each other?

A

Execution can be concurrent or the parent process may wait until children terminate.

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

Describe the fork and exec system calls in UNIX.

A
  • fork: Creates a new process. - exec: Replaces the process’s memory space with a new program after a fork.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is a process terminated?

A

A process terminates by: 1. Executing its last statement and requesting an exit system call

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

What is context switching?

A

Context switching occurs when the CPU switches to another process saving the current process state and loading the state of the next process. The process context is represented in the PCB.

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

Why is context switching considered an overhead?

A

It is time-consuming and does no useful work. The time taken depends on the hardware support.

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

Summarize key points about processes in operating systems.

A
  • A process is a program in execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Where is context switching particularly important?

A

In multi-tasking systems where the OS needs to manage CPU usage efficiently across processes.

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