Processes and threads Flashcards

1
Q

What is a process?

A

A process is a running program

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

States of the process

A

created, waiting, running, blocked, dispatched, interrupted, terminated

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

Created state

A

Process has been retrieved from the memory is move to queue (waiting)

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

Waiting

A

Wait in the queue

Context switch

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

Running

A

Wait for resource (such as input or a file to open), then move to waiting again

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

Dispatched

A

Loaded into the CPU, ready to be run

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

Interrupted

A

When interrupt occurs, save and go back to the waiting

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

Terminated

A

delete the process once its done

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

Context Switch

A

Switch the process that’s currently in the running process with the one in the waiting
Multitasking

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

Threads

A

Simple functions
Couple lines of code
there can be one or more threads in the computer
Created by the process
Subset of the process
Share the data of the process (variables, functions, files, code)
All of the process threads must cooperate
concurrent execution - computations done so quickly it seems like they are executed at the same time

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

Multitasking

A

Cooperative and Pre-emptive multitasking

efficient , concurrent

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

Cooperative multitasking

A

Do tasks so quickly it seems like they are executed at the same time

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

Pre-emptive

A

assign a priority to threads and use a scheduler as well as a time slice (halt the execution of a thread and move it to waiting for another one to be calculated)

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

Interrupts

A

direct message -> electrical signal
IRQ - a line (wire?) reserved for interrupts
Get the CPU’s attention, move the current process form running to waiting, handle the interrupt, continue the process
*timer interrupt : time-based scheduling, occurs every x milisecond

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

PIPELINING

A

it’s purpose is to be able to run multiple cycles and therefore instructions at the same time
If the entire time of fetch, r/d, alu, mem and wrtie is x seconds:
Latency stays the same (x )

Throughput : 1 instruction/(x/number of cycles)

May run intro trouble when encounters a conditional statement

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