@@ -6,7 +6,9 @@ There are two main criteria for performance in multithreaded applications:
6
6
2 . ** Throughput** - The amount of tasks completed in a given period. Measured in _ tasks/time_ unit.
7
7
8
8
9
- ## Latency
9
+ # Latency
10
+
11
+ ** How can we make a task multithreaded?**
10
12
11
13
Suppose we have a single task which can be completed by a single thread sequentially within time T
12
14
@@ -24,16 +26,16 @@ and theoretically we want to achieve the latency of `T/N` (`N` = number of sub-t
24
26
Therefore, we want to do a theoretical reduction in latency by ` N ` = Performance improvement by a factor of ` N ` .
25
27
26
28
27
- ### Few important questions
29
+ ## Few important questions
28
30
29
31
- ` N = ? ` | How many subtasks/threads to break the original task into?
30
32
- Does breaking original task and aggregating results come for free?
31
33
- Can we always break any task in multiple subtasks?
32
34
33
35
34
- #### N = ?
36
+ ### N = ?
35
37
36
- ![ Latency ] ( ../images/latency_4.png )
38
+ ![ N = ? ] ( ../images/latency_4.png )
37
39
38
40
On a general purpose computer : ` N ` should be as close as possible to the number of CPU cores (` N = number of cores ` )
39
41
@@ -63,4 +65,9 @@ We cannot run all the threads 100% in parallel, but we can get close to that!
63
65
64
66
** References:**
65
67
- https://www.hp.com/us-en/shop/tech-takes/what-is-hyperthreading
66
- - https://www.intel.com/content/www/us/en/gaming/resources/hyper-threading.html
68
+ - https://www.intel.com/content/www/us/en/gaming/resources/hyper-threading.html
69
+
70
+
71
+ ### Inherent cost of Parallelization and Aggregation
72
+
73
+ ![ Inherent cost of Parallelization and Aggregation] ( ../images/latency_5.png )
0 commit comments