Wednesday, March 13, 2013

Using volatile Modifier

The volatile keyword indicates that a field might be modified by multiple concurrently executing threads. Marking a field as volatile would make sure that it is not cached dur¬ing the exe¬cu¬tion of a thread.

public volatile int i;

No comments:

Post a Comment