method is thread-safe but not atomic.

Hi,

What is the meaning of 'method is thread-safe, but not atomic.' I have not understood what it exactly means.
please advise
Any links resources ideas highly appreciated. Thanks in advance
LVL 7
gudii9Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
käµfm³d 👽Connect With a Mentor Commented:
Thread safe means that no two threads can be in the "critical section" at the same exact time. "Atomic" means that all of the operations succeed or none of them succeed--there is no partial success. For me, "method is thread-safe, but not atomic" would mean that you have a "critical section" where no two threads can simultaneously enter, but perhaps it's possible that an exception is raised, and that a proper rollback is not performed in the catch block.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.