Originally posted by ADS:
What is volatile and it's use?
Thanks in advance,
ADS
Originally posted by ADS:
What is volatile and it's use?
Thanks in advance,
ADS
Regards,<BR>Shree
Originally posted by David Miranda:
So....
1) volatile is only used in threading?
Originally posted by David Miranda:
2) all thread objects created from a thread class that contains a volatile variable will synchronize the value of that volatile variable for all threads whenever that value is updated?
Originally posted by David Miranda:
The volatile modifier is essentially the same thing as the static modifier, but for threads?
SCJP 1.4 (100%) Done.<br />SCJD (URLyBird 1.2.3 Started)
quote:
--------------------------------------------------------------------------------
Originally posted by David Miranda:
2) all thread objects created from a thread class that contains a volatile variable will synchronize the value of that volatile variable for all threads whenever that value is updated?
--------------------------------------------------------------------------------
Not exactly.
Not only thread class can hold volatile variables. Any class can hold it.
You can read more about volatile here
Mike Gershman
SCJP 1.4, SCWCD in process
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.