Lesson 1: A counter that was wrong every tenth run · 8 min
Before you begin · The bug · What went wrong
Learners sign in, so every finish and score is recorded. 6 fields to fill in with your details.



Minutes are an estimate.
Before you begin · The bug · What went wrong
Compare · Which model? · Check
Tools · Pick the tool · Check
Deadlock · Break it
Patterns · Check
Review checklist · Practice
Taken from the course itself.
What was the root cause of the short total?
Answer: A race condition on shared state. Two workers changed shared state without protection.
Lesson 1: A counter that was wrong every tenth run
What does a mutex guarantee?
Answer: Only one owner holds it at a time. A mutex gives one owner at a time.
Lesson 3: Locks, mutexes and semaphores
What is the usual way to prevent this kind of deadlock?
Answer: Agree one order for taking locks. A fixed order stops a circular wait.
Lesson 4: Race conditions and deadlock
Five workers may use only three database connections.
Best response: A semaphore with a count of three.
Weaker responses: A mutex; No limit; Sleep between calls.
An article from the AhaSlides blog that uses this course.
Comments from trainers
No comments yet. Tell other trainers how the course went.
Your comment
Comments are public. We remove spam and personal details.