Skip to content

Commit 92c00a6

Browse files
committed
Quartz sync: Dec 10, 2024, 5:07 PM
1 parent 7a4bda8 commit 92c00a6

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

content/Studium/Semester 3/Betriebssysteme/Homework/HW_Chapter_28.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,3 @@ Lock if it's unlocked, or spin-wait if it's not. After critical section, check i
4343

4444
-> `./x86.py -p test-and-set.s -M mutex -R ax -a bx=10,bx=10 -P 0011 -c`
4545
Yes, the right thing does happen.
46-
47-
**8**. Now let’s look at the code in peterson.s, which implements Peterson’s algorithm (mentioned in a sidebar in the text). Study the code and see if you can make sense of it.
48-
49-
**9**. Now run the code with different values of -i. What kinds of different behavior do you see? Make sure to set the thread IDs appropriately (using -a bx=0,bx=1 for example) as the code assumes it.
50-
51-
**10**. Can you control the scheduling (with the -P flag) to “prove” that the code works? What are the different cases you should show hold? Think about mutual exclusion and deadlock avoidance.
52-
53-
**11**. Now study the code for the ticket lock in ticket.s. Does it match the code in the chapter? Then run with the following flags: -a bx=1000,bx=1000 (causing each thread to loop through the critical section 1000 times). Watch what happens; do the threads spend much time spin-waiting for the lock?
54-
55-
**12**. How does the code behave as you add more threads?
56-
57-
**13**. Now examine yield.s, in which a yield instruction enables one thread to yield control of the CPU (realistically, this would be an OS primitive, but for the simplicity, we assume an instruction does the task). Find a scenario where test-and-set.s wastes cycles spinning, but yield.s does not. How many instructions are saved? In what scenarios do these savings arise?
58-
59-
**14**. Finally, examine test-and-test-and-set.s. What does this lock do? What kind of savings does it introduce as compared to test-and-set.s?

content/index.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ title: 🌳 Mohammed's Second Brain🧠
33
date: 2024-07-16
44
---
55
![[Banner.png]]
6-
**Welcome to my second brain!**
7-
8-
Hey, ich bin Mohammed und das hier ist mein digitales Gedächtnis. Hier sammle ich alles, was ich lerne, entdecke oder einfach nicht vergessen will. Ob's um Informatik, interessante Konzepte oder einfach nur random Gedanken geht – hier landet alles.
9-
10-
Schau dich um, vielleicht findest du auch was, das dich interessiert oder dir beim Lernen hilft. Lass uns zusammen ein bisschen schlauer werden! 😄
6+
# Welcome to my second brain!
117

128
## 📂 Unterlagen
139

@@ -16,8 +12,4 @@ Schau dich um, vielleicht findest du auch was, das dich interessiert oder dir be
1612

1713
## 📧 Kontakt
1814

19-
🗣️ [Email Adresse](mailto:[email protected])<br>🔊 [Discord Server](https://discord.gg/nwtQs3UMec)
20-
21-
Wenn du Fragen, Kommentare oder einfach nur Hallo sagen möchtest, zögere nicht, dich zu melden!
22-
23-
Viel Spaß beim Stöbern! 😊
15+
🗣️ [Email Adresse](mailto:[email protected])<br>🔊 [Discord Server](https://discord.gg/nwtQs3UMec)

0 commit comments

Comments
 (0)