[concurrency-interest] a question regarding volatile & cache flushing/invalidating

Paulo Levi i30817 at gmail.com
Thu May 14 15:51:12 EDT 2009


I have a small question regarding static values. Do they have to be marked
volatile in order that the new value is visible, or does the new value
eventually get visible. Does volatile work the same for static values
regarding multi-threaded visibility?

The operation that I'm trying to short circuit is a simple boolean value
test to shorten useless (but inoffensive) additional work, as in setting the
(shared) value to false on a exception and then forgetting it. Instances
will be used by many threads off course.

I'm just going to mark the static value as volatile, but i'm curious.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20090514/210c84a0/attachment.html>


More information about the Concurrency-interest mailing list