NEW CD SET 1

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/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:15 PM on 7/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

10 Terms

1
New cards
What's the difference between run() and start() on a Thread?
run() just calls the method on the current thread. start() creates a new thread and has the JVM call run() on it.
2
New cards
What is a race condition and how can it be prevented?
A race condition happens when multiple threads access shared state at once and the outcome depends on timing. Prevent it with locks, semaphores, or atomic variables.
3
New cards
What is the difference between a semaphore and a lock or monitor?
A semaphore is just a counter with acquire() and release(), and any thread can release it, so it has no ownership. A lock does have ownership — only the thread that acquired it can release it.
4
New cards
Describe Java's 6-state thread model (Thread.State).
A thread goes from NEW to RUNNABLE, then maybe BLOCKED, WAITING, or TIMED_WAITING, then finally TERMINATED.
5
New cards
What is meant by "signal and continue" semantics for Condition variables?
Calling signal() doesn't hand over the lock right away. The signalled thread waits to reacquire the lock, then rechecks its condition.
6
New cards
What is a critical section?
A critical section is code that touches shared state and must run on only one thread at a time.
7
New cards
What are the three general approaches to resolving deadlock?
Prevention removes a deadlock condition outright, avoidance checks before granting resources, and detection and recovery lets deadlock happen then fixes it.
8
New cards
What is the difference between Callable and Runnable?
Runnable's run() returns nothing and can't throw checked exceptions. Callable's call() returns a value and can throw one, retrieved via a Future.
9
New cards
What happens to an object's references during serialization?
When you serialize an object, its references get serialized too, but only if they're also Serializable — otherwise you get a NotSerializableException.
10
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.