Add the rest of university notes
This commit is contained in:
366 files changed
+9844
-110
No files matched your search
@@ -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.
|
||||
|
||||

|
||||

|
||||
|
||||
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**
|
||||
|
||||

|
||||

|
||||
|
||||
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
|
||||
|
||||

|
||||

|
||||
|
||||
**Pros and cons of user threads**
|
||||
|
||||
@@ -85,7 +85,7 @@ Advantages:
|
||||
|
||||
However frequent **mode switches** take place, resulting in a lower performance.
|
||||
|
||||

|
||||

|
||||
|
||||
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)
|
||||
|
||||

|
||||

|
||||
|
||||
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
|
||||
|
||||

|
||||

|
||||
|
||||
```
|
||||
$ ~ HELLO from thread 10
|
||||
|
||||
Reference in new issue
Block a user