vault backup: 2025-05-02 18:57:49

This commit is contained in:
2025-05-02 18:57:49 +02:00
parent 73a62f4edd
commit 0553b398fc
6 changed files with 45 additions and 21 deletions

View File

@ -53,7 +53,7 @@ The result depends on when context switching[^1] happens.
The part of the program where shared memory is accessed is called the **Critical Section (CS)**.
### Critical Regions/Sections
![](Pasted%20image%2020250502174340.png)
![|600](Pasted%20image%2020250502174340.png)
### Avoiding race conditions
@ -130,7 +130,7 @@ It defines procedures (i.e. methods).
It uses **condition variables** (often with wait and signal[^3]operations) to allow threads to wait for certain conditions to be met before proceeding.
![](Pasted%20image%2020250502180811.png)
![|600](Pasted%20image%2020250502180811.png)
---

View File

@ -6,7 +6,7 @@ backlinks:
- "[[Overview#Multitasking/Timesharing]]"
---
![](Pasted%20image%2020250502181012.png)
![|300](Pasted%20image%2020250502181012.png)
(C.U. - Control Unit, does FDE and communicates with everything like ALU, registers, etc.)
@ -47,26 +47,27 @@ The first solution for memory management is segmentation.
### Fragmentation
- Each process requires a contiguous block
> [!caution] But fragmentation bad!
> It happens when the free space of the main memory is divided up into multiple parts **between** processes. It's pretty clear why that's bad.
![](Pasted%20image%2020250502182934.png)
![|600](Pasted%20image%2020250502182934.png)
![](Pasted%20image%2020250502183002.png)
![|600](Pasted%20image%2020250502183002.png)
### Memory Allocation Algorithms
Define which free segment should be allocated to a new process.
#### Best Fit
![](Pasted%20image%2020250502183152.png)
![|600](Pasted%20image%2020250502183152.png)
#### Worst fit
![](Pasted%20image%2020250502183221.png)
![|600](Pasted%20image%2020250502183221.png)
#### First fit
![](Pasted%20image%2020250502183242.png)
![|600](Pasted%20image%2020250502183242.png)
#### Compaction
![](Pasted%20image%2020250502183310.png)
![|600](Pasted%20image%2020250502183310.png)
>[!warning]- Issues with this
@ -77,7 +78,7 @@ Define which free segment should be allocated to a new process.
## Direct Memory Access (DMA)
In order to let CPU execute process instructions while data is being transferred from disk to memory, direct memory access (DMA) is used.
![](Pasted%20image%2020250502183523.png)
![|600](Pasted%20image%2020250502183523.png)
## Fix-sized memory blocks
In this scheme, memory is partitioned into blocks of the same size. Every block has the same number of bytes, which makes it easier for the system to keep track of which portions of memory are allocated or available.

View File

@ -116,6 +116,7 @@ int main() {
return 0;
}
```
![example syscall](assets/image.png)