Does access/write to Boolean object needs synchronization
Posted
by Suraj Chandran
on Stack Overflow
See other posts from Stack Overflow
or by Suraj Chandran
Published on 2010-04-16T03:49:33Z
Indexed on
2010/04/16
3:53 UTC
Read the original article
Hit count: 366
This may seem a very silly question. Consider this:
I have a simple Boolean object with a getter and a setter. Now both of the methods are called from a lot of threads very frequently.
- Do I need to have a synchronization for this boolean?
- Also are Boolean assignments atomic operations?
© Stack Overflow or respective owner