diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index c42d483..1503b70 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -186,6 +186,9 @@ }, "active": "cca189cd61cd7fe5", "lastOpenFiles": [ + "Pasted image 20231018120412.png", + "Pasted image 20231018120219.png", + "Pasted image 20231018120028.png", "Pasted image 20231018115329.png", "Pasted image 20231018115103.png", "Pasted image 20231018114101.png", @@ -228,9 +231,6 @@ "4a1s/ASCN/T.32118", "4a1s/ASCN/Images.md.32118", "script.sh", - "quartz/static/og-image.png", - "quartz/static/icon.png", - "docs/images/quartz transform pipeline.png", - "docs/images/quartz layout.png" + "quartz/static/og-image.png" ] } \ No newline at end of file diff --git a/4a1s/CP/PL - Aula 6.md b/4a1s/CP/PL - Aula 6.md index 06837bb..68ecb72 100644 --- a/4a1s/CP/PL - Aula 6.md +++ b/4a1s/CP/PL - Aula 6.md @@ -17,6 +17,8 @@ NOTE: These threads use a fork-join architecture, aka both threads work simultan ### c) It is dependant on the CPU availability in each clock cycle. A thread, when executed uses + +* * * ## Ex 2 ### 2.1 - \#pragma omp for ![[Pasted image 20231018115329.png]] @@ -26,6 +28,30 @@ Thread 0 -> ids 0-49 Thread 1 -> ids 50-99 #### b) Yes, since it is statically distributed. -#### c) + +### 2.2 - \#pragma omp master +![[Pasted image 20231018120028.png]] +#### a) +There is a distribution of literally all the prints on the first thread created. There is a static distribution of instructions to the first thread created - the thread master. +Thread 0 -> ids 0-99 +#### b) +Yes, since it is statically distributed. +### 2.3 - \#pragma omp single +![[Pasted image 20231018120219.png]] + +#### a) +There is a distribution of literally all the prints on the first thread created. There is a static distribution of instructions to one of the threads randomly. +Thread 0/1 -> ids 0-99 +#### b) +Yes, since it is statically distributed. + +#### c) \#pragma omp critical +![[Pasted image 20231018120412.png]] + +There is a restriction on the thread access to the printing - each thread is forced to complete the entirety of the task and it cannot end the printing until it is completed with its task. + + +**** +### Ex 3 diff --git a/Pasted image 20231018120028.png b/Pasted image 20231018120028.png new file mode 100644 index 0000000..7a4c5e7 Binary files /dev/null and b/Pasted image 20231018120028.png differ diff --git a/Pasted image 20231018120219.png b/Pasted image 20231018120219.png new file mode 100644 index 0000000..ef4fc6a Binary files /dev/null and b/Pasted image 20231018120219.png differ diff --git a/Pasted image 20231018120412.png b/Pasted image 20231018120412.png new file mode 100644 index 0000000..45816d4 Binary files /dev/null and b/Pasted image 20231018120412.png differ