Week 2 Flashcards

1
Q

What is a process?

A

A process is the unit of work in a modern computing system.

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

What are the four sections of a process?

A
  1. Stack - contains temporary data
  2. Heap - contains memory which is dynamically allocated during run time
  3. Data - contains global variables
  4. Text - contains the program code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between a program and a process?

A

A program is a passive entity that is stored on a disk where as a process is active and comes from a program when an executable file is loaded into memory. (One program can be several processes)

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

What are the five states of a process as it is executing?

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
5
Q

What is a PCB?

A

A process control block (PCB) represents a process and contains many pieces of information relating to that process such as:
- 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
6
Q

What is process scheduling?

A

Process scheduling is where a process scheduler selects an available process for program execution on a core. Each CPU core can run one process at a time.

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

What are the two different types of scheduling queues?

A
  1. Ready queue - contains all processes residing in main memory waiting to execute
  2. Wait queue - contains processes waiting for an event to occur (i.e completion of I/O)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a context switch?

A

A context switch is performed when the CPU core needs to switch from one process to another. A save state is performed for the current process and a state restore is performed for a different process. The kernel saves the context of the old process and loads the saved new process scheduled to run

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

What is process creation?

A

Process creation is where a parent process creates new processes called children processes. Those children processes can than also create new processes. This creates a process tree.

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

What is a thread?

A

A thread is a segment of a process. A process can have multiple threads and most modern applications are multithreaded.

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

What are the 4 benefits of multithreading?

A
  1. Responsiveness - May allow continued execution if part of process is blocked, especially important for user interfaces
  2. Resource Sharing - Threads share resources of process
  3. Economy - cheaper than process creation, thread switching lower overhead than context switching
  4. Scalability - process can take advantage of multicore architectures
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does multicore / multithreaded programming provide?

A

Multicore and multithreaded programming provides a mechanism for more efficient use of multiple computing cores and provides improved concurrency.

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

What are the two types of parallelism?

A

Data parallelism - Distributes subsets of the same data across multiple cores, same operation on each

Task parallelism - Distributes threads across cores, each thread performing unique operation

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

What is the difference between concurrency and parrellism?

A

Concurrency supports more than one task making progress, parallelism implies a system can perform more than one task simultaneously.

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