Consider this Reader/Writer Lock implementation. Select all that hold.
Week 11

Quiz
•
Computers
•
University
•
Hard

Hansjörg Schraubenzieher
Used 9+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Prioritizes readers.
Prioritizes writers.
Would also work when replacing notifyAll() with notify().
2.
MULTIPLE SELECT QUESTION
3 mins • 1 pt
Fill in the blank for the while(......) condition in acquire_read(), s.t:
- the lock works correctly
- AS FAIR AS POSSIBLE (given the available variables)
- it's not completely inefficient
writers>0 || readers>0
writers>0 || writersWaiting>0
writers>0 || (writersWaiting>0 && writersWait<=0)
writers>0 || (writersWaiting>0 && writersWait>0)
writers>0 || writersWait<=0
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Fill in the blank for the while(.....) condition in acquire_write() method, s.t:
- the lock works correctly
- lock is AS FAIR AS POSSIBLE (given available variables)
writers>0 || readers>0
writers>0 || writersWait>0
writers>0 || readers>0 || readersWaiting>0
writers>0 || readers>0 || writersWait>0
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Implementing the methods this way corresponds to:
optimistic locking
fine-grained locking
lazy locking
coarse-grained locking
5.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
This is the add() method of a concurrent linked list. What holds (multiple can be correct) given multiple threads can access add() concurrently?
No bad interleavings possible.
Bad interleavings possible.
Implementation uses fine-grained locking
Implementation uses coarse-grained locking.
6.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
This is the add() method of a concurrent linked list. What holds (multiple can be correct)?
No bad interleavings possible (correct implementation).
Bad interleavings possible (incorrect implementation).
Uses hand-over-hand locking.
Uses optimistic locking.
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Fine-grained Locking (using hand-
over-hand locking) on a linked list re-
quires us to validate if a node is still
reachable before deleting it.
True
False
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
Komposter

Quiz
•
University
7 questions
Session 7

Quiz
•
University
10 questions
Concurrency Control

Quiz
•
University
10 questions
Expression in C Programming

Quiz
•
University
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops

Quiz
•
9th Grade - University
13 questions
C programming-1

Quiz
•
University
15 questions
BASIC C PROGRAMMING QUIZ

Quiz
•
University
12 questions
Operators in C

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade