Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Java
Javahard

Java Memory Model: what does “happens-before” mean (in simple terms)?

Tags
#jmm#happens-before#concurrency#visibility
Back to categoryPractice quiz

Answer

Happens-before is a rule that guarantees visibility and ordering between threads. If A happens-before B, then B must see the effects of A (e.g., via `synchronized`, `volatile`, or thread start/join).

Related questions

Java
HashMap vs ConcurrentHashMap: when should you use each?
#java#collections#concurrency
Java
`synchronized` vs `ReentrantLock`: what are the differences?
#java#concurrency#locks
Java
Parallel streams: when can they help and what are common pitfalls?
#java#streams#parallel
Java
`synchronized` vs `ReentrantLock` - when would you choose one?
#concurrency#locks#synchronized
Java
What does `ThreadLocal` do and what is a common pitfall?
#threadlocal#concurrency#thread-pool
Java
Why is `ArrayList` not thread-safe, and how can you make list access safe?
#concurrency#arraylist#thread-safety