Atomic properties are thread safe.
To understand atomic property it is important first to take a little focus on multi-thread programming. In multi-thread programming different threads can use same property so it is must to apply thread handling. With atomic property not more than one thread can use same property as 'atomic' applied.
For example thread x is applying setter method on 'name' property and simultaneously thread y is applying getter method then until thread x changes name thread y can not access name. So it has to wait until thread x performing its task.
By example we can understand that this behavior make it slow as other threads has to wait. As a solution 'non-atomic' properties are used, which are not thread safe so faster than atomic.
0 Comment(s)