chapter 5 Flashcards

1
Q

General info about processes

A
  • each process is indep, even tho multiple processes run on the same CPU
  • they often share resources like code and data
  • threads within a process operate in the same @ space
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Virtual mem

A
  • MMU is used to map a single physical memory area into multiple @ spaces, maps virtual @s used by processes to the actual physical @ in mem.
  • abstraction that allows each process to believe it has its own continuous block of mem, however RAM is shared between all processes.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Race conditions

A

happen when multiple processes try to access and manipulate shared data at the same time.

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

shared mem

A

is a common method for IPC, where multiple processes can access the same mem to exchange info

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

threads

A
  • access shared variables, thus synchro is needed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

synchro

A
  • manage how processes work together and how they manage shared resources
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

synchro strategy: lock variables

A

lock is global lock variable. critical section must acquire it and release it afterwards (similar to binary semaphore)

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

Lamport bakery algo

A

before a process is allowed to enter the critical section, it is assigned a wait number, this number indicates the position of the process in the queue to enter the critical section. The lowest wait number is the first to enter the critical section.

  • problem if 2 processes have the same wait number, to mitigate this problem, having priorities could help
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Busy waiting

A
  • is when a process continuously checks if the lock is available, while it is blocked from proceeding. It holds teh CPU, restricting other processes from executing even if they are ready
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

synchro strategy: cli and sti

A
  • cli is clear interrupt flag: disables interrupts ensiring that the current process isnt interrupted while it is in the critical section.
  • sti is set interrupt flag: re-enables interrupts after the process finished executing he critical section.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Active waiting

A
  • processes voluntarily yield control of the CPU while they wait for an event to occur. The PCB of the waiting process is placed in a queue and remains there until the event it is waiting for is ready. The waiting phase is called blocking phase
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

synchro strategy: semaphore

A
  • it is a non-negative int thats manipulated by P (wait) and V (signal).
  • implemets passive waiting
  • P is decrement/wait: semaphore is decremented, signaling that the resource isnt available, being used
  • V is increment/signal: semaphore is incremented, signaling that the resource is available again to be used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Unilateral synchro

A

producer and consumer, consumer waits for resources produced by the producer

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

Multilateral synchro

A

mutual exclusion

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