Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14


  1. Default

    The java volatile keyword guarantees that value of the volatile variable will always be read from main memory and not from thread's local cache.

  2. #12

    Default

    1. volatile is the modifier applicable only for variables but not for methods and classes.
    2. If the value of a variable kept on changing such type variables we have to declare with a volatile modifier.
    3. If a variable declared as volatile then for every thread a separate local copy will be created.
    4. Every intermediate modification performed by that thread will take place in a local copy instead of the master copy.
    5. Once the value got finalized just before terminating the thread the master copy value will be updated with local stable value.
    6. The main advantage of volatile keyword is we can resolve data inconsistency problems.
    7. But the main disadvantage of volatile keyword is creating and maintaining a separate copy for every thread increases the complexity of the programming and effects performance of the system. Hence, if there is no specific requirement it is never recommend to use volatile keyword and it is almost outdated keyword.
    8. volatile variable means it's value keep on changes where asfinal variable means its value never changes. Hence final volatile combination is illegal combination for variables.

  3. Default

    Thanks

  4. Default

    Using volatile is yet another way (like synchronized, atomic wrapper) of making class thread safe. Thread safe means that a method or class instance can be used by multiple threads at the same time without any problem.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Replies: 1
    Last Post: 11-11-2013, 01:12 AM
  2. In google adwords keyword tool why does a keyword search for magnetic bracelets show
    By watson.johe86 in forum Internet Marketing, SEO, PPC, Web Development Forums
    Replies: 0
    Last Post: 04-26-2013, 09:50 AM
  3. Replies: 2
    Last Post: 06-06-2012, 08:45 AM
  4. What is diffrence between exact keyword and broad keyword research?
    By poucanet in forum Internet Marketing, SEO, PPC, Web Development Forums
    Replies: 2
    Last Post: 11-17-2011, 19:56 PM
  5. Replies: 0
    Last Post: 10-28-2011, 01:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
| UKC | VPS Germany | Webmaster Marketplace | Web Hosting Forum | Domain Name Forum | VPS Forum | Webmaster Forum | Website Design Forum | Sites For Sale |