Session 7

Session 7

University

7 Qs

quiz-placeholder

Similar activities

Mobile Computing P11

Mobile Computing P11

University

10 Qs

CSS (background-position-list)

CSS (background-position-list)

1st Grade - University

10 Qs

java quiz on Encapsulation and Abstraction

java quiz on Encapsulation and Abstraction

University

10 Qs

UTILITY PROGRAM

UTILITY PROGRAM

University

10 Qs

Data Warehouse - Foundations

Data Warehouse - Foundations

University

10 Qs

Quiz3_DivideConquer_GreedyApproach

Quiz3_DivideConquer_GreedyApproach

University

10 Qs

Python with DataScience

Python with DataScience

7th Grade - University

10 Qs

UAS Sistem Operasi Open Source

UAS Sistem Operasi Open Source

University

10 Qs

Session 7

Session 7

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Rafael Wampfler

Used 74+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the "immutability" approach in terms of managing parallel programs?

Only using one thread

Not having data that changes

Different threads only access different data

Only using Atomics

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is mutual exclusion?

Different threads only access different data

Having all shared ressources as read only

Only one thread can access a shared ressource at a time

Not using both locks and synchronized blocks in the same programm

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if a thread calls .lock() on a ReentrantLock it already has?

We get a runtime error

The program doesn't compile

It increments the count of the lock by 1 and moves on

The thread waits forever

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a thread locks the same Java ReentrantLock twice, you have to unlock twice as well.

True

False

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is coarse-grained locking and what are its advantages?

Using one lock for many objects; Simpler to implement

Using one lock for each object; More simultaneous access possible

Using many locks for one object; Safer than just one lock

Using one lock for many objects; More simultaneous access possible

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You can't have bad interleavings on a machine with only one processor.

True

False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Bad interleavings and Data Races are the same.

True

False