Add the rest of university notes

This commit is contained in:
John Gatward committed 2026-10-04 14:02:35 +01:00
1 parent c1b84c7f7d
commit d0f27f276b
366 files changed
+9844 -110

No files matched your search

+7 -7
View File
@@ -10,7 +10,7 @@ A process consists of two **fundamental** units
A process can share its resources between multiple execution traces, e.g multiple threads running in the same resource environment.
![Image](/lectures/osc/assets/9.png)
![Image](assets/9.png)
Every thread has its own *execution context* (e.g. program counter, stack, registers).
All threads have **access** to the process' **shared resources**
@@ -22,7 +22,7 @@ All threads have **access** to the process' **shared resources**
Similar to processes, threads have:
**States**, **transitions** and a **thread control block**
![Image](/lectures/osc/assets/a.png)
![Image](assets/A.png)
The *registers*, *stack* and *state* are all specific to the registers. When a context switch occurs they must be stored in the **thread control block**.
@@ -60,7 +60,7 @@ Such activities should be carried out in parallel on threads. e.g. web-servers,
**Kernel** threads - ask the OS to create a tread for the user and give it to the user.
**Hybrid** implementations - is what is used in windows 10
![Image](/lectures/osc/assets/d.png)
![Image](assets/d.png)
**Pros and cons of user threads**
@@ -85,7 +85,7 @@ Advantages:
However frequent **mode switches** take place, resulting in a lower performance.
![Image](/lectures/osc/assets/e.png)
![Image](assets/E.png)
Kernel threads are slower to create and sync that user level however user level cannot exploit parallelism.
@@ -96,7 +96,7 @@ Kernel threads are slower to create and sync that user level however user level
>
>User application sees user threads and creates/schedules these (an unrestricted number)
![Image](/lectures/osc/assets/f.png)
![Image](assets/f.png)
Thread libraries provide an API for managing threads
Thread libraries can be implemented
@@ -113,9 +113,9 @@ Examples of thread APIs include **POSIX PThreads**, windows threads and Java thr
`pthread_attr_init` - Thread Attributes (e.g. priority)
`pthread_attr_destroy` - Release Attributes
$ ~ man `pthread_create` returns the help page
`$ ~ man pthread_create` returns the help page
![img](/lectures/osc/assets/g.png)
![img](assets/G.png)
```
$ ~ HELLO from thread 10