
Week 14

Quiz
•
Computers
•
University
•
Hard
Andreas Ellison
Used 16+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Mark one ADVANTAGE and one DISADVANTAGE of STM (Software Transactional Memory, as opposed to Hardware Transactional Memory)
worse performance
better performance
can be used flexibly, without support from the hardware
more work for the programmer
2.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
What does the programmer have to pay attention to when using shared mutable state with reference-based STMs (e.g. scala-stm)?
variables must be volatile
special reference variables/objects must be used for the shared state
the program should not directly modify the shared state by itself
the programmer must remember to add accesses to the read/write set
when using `retry`, one must specify all variables for which updates should be detected
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Atomic registers can be used to implement CAS
True
False
Answer explanation
We know from the lecture that atomic registers have consensus number 1. If we could implement CAS with atomic registers, we then could use that to solve 2-thread (or n-thread) consensus, a contradiction.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The following code is a correct consensus protocol for 2 threads
True
False
Answer explanation
An execution is possible where both threads read i == -1 one after the other. Then they both return their own inputs, which may differ.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
True
False
Answer explanation
False, the implementation is blocking. If a thread stops executing while holding the lock, the other thread can execute infinitely many steps without finishing, contradicting wait-freedom.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
True
False
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
True
False
Answer explanation
The construction of a consensus protocol for 2 threads using a queue was shown in the lecture (or see page 107 of the book). What should be surprising is that this is a correct protocol even if the queue is only lock-free. It turns out that any lock-free consensus protocol is also wait-free. Since there is a finite number of threads and a single consensus call from each thread, we can argue that any single call will be wait-free: while the call by a thread A is pending, a call by some thread is guaranteed to finish in a finite number of steps by lock-freedom. After this finite number of steps, we can again apply lock-freedom and know that some other call will finish in a finite number of steps. At the latest, the call on thread A will finish after all other threads have completed their calls.
8.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
True
False
Answer explanation
This was a question in last year's exam.
9.
FILL IN THE BLANK QUESTION
5 mins • 1 pt
Match the entries on the left with the MPI operations on the right. (Top to bottom, NO SPACES)
Similar Resources on Wayground
10 questions
Blockchain

Quiz
•
5th Grade - Professio...
10 questions
SA Ch2-3 & SDLC

Quiz
•
University
12 questions
G4R intro

Quiz
•
KG - Professional Dev...
10 questions
Teknologi Informasi dan Komunikasi

Quiz
•
University
10 questions
SRD QUIZ 3 CHAPTER 4

Quiz
•
University
12 questions
Threads in C# Quiz

Quiz
•
University
10 questions
Construct 3 Quiz - Game Development

Quiz
•
2nd Grade - Professio...
10 questions
Pengenalan Brainware Komputer

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University