Unit 2: Process Management Flashcards

1
Q

What is a process?

A

A process is a program in execution

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

What distinguishes a program from a process?

A

A program is a passive entity stored on disk, while a process is the active execution of that program in memory

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

What are the key components of a process in memory?

A
  • Text section (code)
  • Data section (global/static variables)
  • Heap (dynamic memory)
  • Stack (temporary data)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the new state of a process signify?

A

It indicates that a process is being created and the OS has copied the program from secondary to main memory

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

What is the ready state of a process?

A

The ready state is when a process is waiting to be assigned to a processor, typically residing in the ready queue

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

What occurs in the running state of a process?

A

The process’s instructions are being executed by the CPU

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

What does the waiting state of a process entail?

A

The process is waiting for some event to occur, such as I/O completion

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

What does the terminated state of a process indicate?

A

The process has finished its execution

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

What is a Process Control Block (PCB)?

A

The PCB stores essential information associated with each process, allowing the OS to manage it

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

What key information is found in a PCB?

A
  • Process state
  • Program counter
  • CPU registers
  • CPU scheduling information
  • Memory-management information
  • Accounting information
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the function of the job queue?

A

Holds a list of all processes in the system

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

What does the ready queue contain?

A

Processes residing in main memory and ready to execute

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

What is the purpose of device queues?

A

Hold processes waiting for a specific I/O device

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

What happens during process migration?

A

Processes move between the various scheduling queues during their lifecycle

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

What is context switching?

A

Saving the state of one process and restoring the state of another, often triggered by interrupts

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

What does the fork() system call do?

A

Creates a new child process, which is initially a duplicate of the parent

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

What is the function of the exec() system call?

A

Replaces the current process’s memory space with a new program after a fork()

18
Q

How does a process terminate?

A

By executing its last statement and using the exit() system call, potentially returning a status to the parent

19
Q

What does the abort() system call do?

A

Allows a parent process to terminate child processes for reasons like exceeding resources

20
Q

What are independent processes?

A

Processes that cannot affect or be affected by others

21
Q

What are cooperating processes?

A

Processes that can affect or be affected by others

22
Q

What are some reasons for process cooperation?

A
  • Information sharing
  • Computation speedup
  • Modularity
  • Convenience
23
Q

What is Inter-Process Communication (IPC)?

A

Needed for cooperating processes to exchange data and synchronise

24
Q

What is shared memory IPC?

A

A region of memory shared between processes, allowing direct access for communication, but requiring user-managed synchronisation

25
What is message passing IPC?
Processes communicate by sending and receiving messages, with communication handled by the OS
26
What is a thread within a process?
A single sequential flow of execution within a process
27
What are the benefits of multithreading?
* Responsiveness * Resource sharing * Economy * Scalability
28
What is the difference between user threads and kernel threads?
User threads are managed by user-level libraries, while kernel threads are supported by the OS kernel
29
What is the many-to-one thread model?
Multiple user-level threads map to a single kernel thread, potentially causing blocking issues
30
What is the one-to-one thread model?
Each user-level thread maps to a separate kernel thread, offering more concurrency but with potential overhead
31
What is the many-to-many thread model?
Multiple user-level threads can be mapped to multiple kernel threads, offering flexibility and concurrency
32
What do thread libraries provide?
An API for creating and managing threads, and can be implemented in user space or kernel space
33
What are Pthreads?
A POSIX standard API for thread creation and synchronisation, commonly used in UNIX-like systems
34
How are Java threads managed?
Managed by the JVM and typically implemented using the underlying OS thread model
35
What is the role of the CPU scheduler?
Selects which ready process will be allocated the CPU next
36
What is the difference between preemptive and non-preemptive scheduling?
Preemptive allows the CPU to be taken away, while non-preemptive runs the process until completion or blocking
37
What is FCFS scheduling?
First-Come, First-Served scheduling executes processes in the order they arrive in the ready queue
38
What is SJF scheduling?
Shortest-Job-First scheduling executes the process with the shortest burst time next
39
What is Round Robin scheduling?
Allocates a small unit of CPU time (time quantum) to each process in the ready queue in a circular manner
40
What are common CPU scheduling criteria?
* CPU utilisation * Throughput * Waiting time * Turnaround time * Response time