1/6
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
When is CAS better than locks?
CAS is better than locks under light contention, since a failed thread just retries instead of blocking.
How can a reentrantlock be fair?
new ReentrantLock(true) gives the lock to the longest-waiting thread first, at the cost of some throughput.
Explain drawbacks of using parallel streams, list two
They run slower on small datasets due to the extra work of splitting and joining tasks. They can cause data errors if you modify shared variables or require strict processing order.
Explain how a server socket can prevent over threading and improve performance.
A thread pool caps how many threads handle connections at once, so extra clients queue instead of spawning new threads.