Week 3: Processes (Model trafficing schedulling) Flashcards

1
Q

Why do modern computers appear to perform multiple tasks simultaneously?

A

The processor switches between programs multiple times per second, giving the illusion of multitasking.

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

What is the role of the operating system in multi-programming?

A

To keep track of running programs and manage the switching between them.

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

How must processes be executed?

A

They must execute sequentially even though they may be interrupted so other processes can run.

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

What is a process tree?

A

It’s a hierarchy where parent processes create child processes, which in turn can create their own child processes.

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

What are the three resource-sharing options during process creation?

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

What are the two resource-sharing execution options during process creation?

A
  • Parent and children execute concurrently
  • Parent waits until children terminate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the two resource-sharing program options during process creation?

A
  • The child is a duplicate of the parent
  • The child has a program loaded into it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What occurs during normal process termination?

A

The process executes its final instruction, exits, ensures output data is written, and deallocates its resources.

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

Under what circumstances might a parent process terminate a child process?

A

If the child exceeds a resource limit, becomes stuck, or if the parent process itself is terminated.

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

What are the five states of a process?

A
  • New
  • Ready
  • Running
  • Blocked (Waiting)
  • Terminated.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does it mean when a process is “Blocked”?

A

The process is waiting for an event to occur.

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

What typical information does the operating system hold about a process?

A
  • Process management information: process state, program counter, processor registers, time process started,
    process ID, parent ID
  • Memory management information: code location and size, data location and size, stack
  • I/O management information: files open and modes, I/O devices in use, current directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why is process information necessary?

A

To allow the operating system to resume a process in the correct state after an interruption.

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

What is the purpose of process tables in an operating system?

A

To store information about each process, enabling management and state tracking.

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

What happens to a process’s table entry when it is interrupted?

A

The operating system updates the process’s state and any related information.

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

What are the two types of interrupts?

A
  • Software
  • Hardware
17
Q

What happens when an interrupt occurs?

A

The microprocessor finishes the current instruction and passes control to an interrupt handling routine.

18
Q

What is preserved during interrupt handling?

A

The state of essential registers, including the program counter, is preserved to enable the resumption of execution.

19
Q

What governs the execution of interrupt handling routines?

A

The operating system decides which code runs based on the type of interrupt.

20
Q

What is a clock interrupt?

A

A hardware interrupt triggered when an internal timer reaches zero, to interrupt user processes that are simply doing long calculations

21
Q

When is it only possible to change the value of the internal timer of the clock interrupt?

A

When the operating system is in privileged mode

22
Q

What happens during a context switch?

A

The operating system saves the state of the old process and loads the saved state of a new process to run it

23
Q

What factors influence the time taken for context switching?

A

The efficiency of the operating system and the level of hardware support.

24
Q

Why is the time spent on context switching considered overhead?

A

Because the system does no useful work while switching

25
Q

In what does the amount of time context switching take depend?

A

The operating system and the hardware

26
Q

What are the different classes of scheduler types?

A
  • Long-term: selects which processes should be brought into the queue
  • Medium-term: selects which process is temporarily suspended and swapped out of main memory to reduce the number of processes occupying memory
  • Short-term: selects which process should be executed by the processor
27
Q

What is the race condition?

A

The condition which its result depends on the race (timing) of two processes.