2025 Jan CD short q's

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/5

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:21 PM on 8/6/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

6 Terms

1
New cards
3 processes share 4 resource units, max 2 each — show deadlock cannot occur.
Worst case: all 3 hold 1 unit and wait for a 2nd. Only 3 of 4 units used, 1 spare. Circular wait can't happen because the spare can be given to a waiting process.
2
New cards
What are the four key characteristics of fair locks? Explain each one.
FIFO ordering, no barging, lower throughput, created with new ReentrantLock(true).
3
New cards
What are the benefits of immutable streams?
A stream never modifies its source, so it's inherently thread safe to read from.
4
New cards
What is object serialization, and how do you implement it?
Serialization turns an object's state into bytes. Implement it via Serializable, or Externalizable, which needs writeExternal() and readExternal().
5
New cards

Explain what is meant by encapsulated classes.

Encapsulation bundles a class's data with the methods that operate on it, while hiding the internal state from the outside.

6
New cards
What is a non-blocking, lock-free data structure?
A lock-free structure stays thread safe without locks, usually using compare-and-swap. Some thread always makes progress, so there's no deadlock, but threads may retry under contention.