Exforsys

Online Training

keyword

This is a discussion on keyword within the Java forums, part of the Programming Talk category; what is use of volatile keyword??...


Go Back   Exforsys > Programming Talk > Java

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-07-2008, 04:50 AM
Junior Member
 
Join Date: Mar 2008
Location: bangalore
Posts: 9
sampra is on a distinguished road
Red face keyword

what is use of volatile keyword??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-07-2008, 06:21 AM
Member
 
Join Date: Jan 2006
Posts: 34
Guptha_S is on a distinguished road
When we try to access a field, VM Optimizes field access by temporary result in local variable

Volatile is useful when we want to access a field with multiple threads without synchronizing.

When we use Volatile keyword, Above mentioned VM's optimization feature is disabled and the temporary results will not be stored in local variable.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-07-2008, 07:52 AM
Junior Member
 
Join Date: Mar 2008
Location: bangalore
Posts: 9
sampra is on a distinguished road
can u gv a small example
Quote:
Originally Posted by Guptha_S View Post
When we try to access a field, VM Optimizes field access by temporary result in local variable

Volatile is useful when we want to access a field with multiple threads without synchronizing.

When we use Volatile keyword, Above mentioned VM's optimization feature is disabled and the temporary results will not be stored in local variable.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
QTP Material kalyansantosh Software Testing 5 05-08-2008 01:52 AM
using a variable between 2 programs itzsug C and C++ 9 03-10-2007 04:28 PM
process nageswari Software Testing 3 02-15-2007 07:15 PM
ORA-00923: FROM keyword not found where expected rite2sekhar Oracle Database 0 03-02-2006 06:01 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 07:00 AM


All times are GMT -4. The time now is 12:27 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.