Autosave: 2024-07-07 19:00:04

This commit is contained in:
thomasabishop 2024-07-07 19:00:04 +01:00
parent c4045ea9a0
commit aa16fcba7c
4 changed files with 17 additions and 12 deletions

Binary file not shown.

View file

@ -1,5 +1,4 @@
---
id: {{id}}
title: {{title}}
tags: []
created: {{format-date now "full"}}

View file

@ -32,11 +32,11 @@ utilise threads.
## Hardware considerations
Each [processor core](./CPU_architecture.md) can only one one thread at a time
Each [processor core](./CPU_architecture.md) can only run one thread at a time
so the number of cores that a device's CPU has deterimines how many threads can
run at once. In practice, then, the CPU shuffles between multiple threads in
clock segments. This is known as scheduling and is managed by the process that
the thread belongs to.
[clock segments](./Clock_signals.md). This is known as scheduling and is managed
by the process that the thread belongs to.
## Related notes

View file

@ -9,23 +9,29 @@ tags:
## What is virtual memory?
Virtual memory is implemented at the level of the operating system and is an
abstraction on top of 'real', physical memory (i.e the charges stored within the
actual DRAM component.).
abstraction on top of 'real', physical memory (i.e the bits stored within the
[DRAM](./Memory.md#DRAM).
When virtual memory is used, the CPU handles physical memory allocation and
presents this to the kernel as an idealised representation. This means that the
kernel and, by extension, programs and processes do not need to think about
accessing the real memory blocks. This reduces complexity because often memory
will be allocated in places that are non-contiguous with similar running
processes or be located in the cache or swap memory on the disk.
presents this to the kernel as an idealised representation.
![](/img/virtual-memory-diagram.jpg)
This means that the kernel ( and, by extension, programs and processes) does not
need to think about accessing the real memory blocks.
This reduces complexity because often memory will be allocated in places that
are non-contiguous with similar running processes and may even be located in the
cache or in swap memory on the disk, rather than the actual main memory.
Virtual memory presents a unified abstraction to the kernel over and above these
specific memory locations.
It would require considerable processing work for the kernel to be tracing these
disparate memory sources at every instance. By working on an idealised
(contiguous, unlimited) memory set the kernel can focus on task management and
CPU sequencing as its primary task.
![](/img/virtual-memory-diagram.jpg)
The memory is idealised in that all locations are represented virtually as being
contiguous (even when this is not physically the case). Secondly, quantities of
available memory can be presented as much larger than is actually the case and