Search Header Logo

Session 10

Authored by Rafael Wampfler

Computers

University

Used 13+ times

Session 10
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why are locks not enough in some situations?

They can't always guarantee mutual exclusion.

They don't allow threads to communicate about changes in the state.

We can only use one lock at a time.

They are too boring.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A semaphore and a barrier are functionally the same.

True

False

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

How do we prevent processes from "overtaking" other processes in a reusable barrier? (without breaking it)

By taking "if (count==n)" out of the mutex

This is not possible with just semaphores

By using a two-phase barrier

By using fewer than n processes

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A Java ReentrantLock has a monitor associated with it.

True

False

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is not a thread state in Java?

TERMINATED

TIMED_WAIT

BLOCKED

LOCKED

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When a thread is in the WAITING state and receives a notify, it goes into which state?

RUNNABLE

BLOCKED

RUNNING

READY

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Only one thread at a time can own an object's monitor (in Java).

True

False

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers