Operating System Process (PPT 2) Flashcards

1
Q

What is a process?

A

It is a program in execution

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

What is a process made up of?

A
  • Code
  • Data, including the stack
  • Operating Systems data structures
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the six process states that can occur?

A
  • New
  • Ready
  • Running
  • Blocked
  • Exit
  • Suspend
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can a single process go through multiple states?

A

Yes, it can. You can build a history of the process from these states.

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

How many processes can have the Running state at one time (single core system)?

A

Only one process can have the Running state. Once it times out, the process is moved from Running to Ready and the next process is allowed to go.

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

How can a process become Blocked?

A

A process can become blocked if it has to wait for anything, such as a keystroke. It is then moved to the blocked state and can only move back to the Ready state if the event it was waiting for occurs

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

What is the Suspend state?

A

Suspend allows the OS to remove a blocked process completely from memory, allowing a new process to be started or return an old process back into memory. This occurs over and above the normal Virtual Memory operation.

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

Why would the OS need two suspend states?

A

It may need two suspend states, one for Ready suspend and one for Blocked suspend, because it allows the OS to avoid bring a suspended process back into memory just to know if it is still blocked. A process can move from Blocked suspend to Ready suspend once it is no longer blocked, allowing for it to be brought back in.

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

What is a Process Image?

A

This is what the process consists of while it sits in memory. It is a snapshot of its state at any given time

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

What does a Process Image Contain?

A
  • User Data
  • User Program Code
  • System Stack
  • Process Control Block (PCB)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a Process Control Block?

A

It is a data structure which contains all the necessary information which allows the scheduling of a particular process

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

What does a PCB contain?

A
  • Process ID
  • Processor State Information (CPU registers, stack pointers)
  • Processor Control Information:
  • processor state, priority, scheduling info, event
  • data structures, inter-process communication
  • privileges, memory management, resource ownership
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Process Switching?

A

Taking one process off the CPU and putting another one onto the CPU. Process switch may occur when the OS has control of the CPU. There are three ways to do this:

  • External Interrupt
  • Trap
  • Supervisor/System call
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the Context?

A

Any information about the state of one process that would be changed by the execution of another process

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

What is Context Switching?

A

Changing the context which the CPU is using

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

What is the difference between Process and Context switching?

A

A process switch takes longer as there is much more to do while a Context switch doesn’t always mean a process switch. Instead, it may be just a thread switch within one process.

17
Q

What are the steps in a Process Switch?

A

1) Save context of the CPU
2) Update PCB of the running process
3) Move the PCB to the right Queue
4) Select another ready process
5) Update and move the PCB of the chosen process
6) Restore the context of the chosen process
7) Continue Execution

18
Q

What are the two key characteristics of a process?

A

-Resource Ownership
Everything owned by the process

-A Thread of Execution
Information about what the process is, where it is in the program and what it is doing. Also the contents of the Program Counter, Processors Status Word and the other internal Registers (the Context)

19
Q

Why are threads useful?

A

Changing between threads is just a context switch so therefore light rather than a costly process switch. It makes programs more efficient.

20
Q

What are the main reasons for using threads?

A

-Foreground and background work
-Asynchronous Processing
Can use threads for auto save, for example
-Speed of execution
-Organising Programs