[concurrency-interest] dealing with people thatquestionvisibility problems
dcholmes at optusnet.com.au
Wed Feb 21 19:19:35 EST 2007
> Howver, going to the extreme of making every field either final
> or volatile is pointless. If a field has visibility issues
> because it isn't volatile, there's a good chance that it also has
> atomicity issues that volatile can't fix.
And I'll add that this just demonstrates that the programmer doesn't
understand the code they are writing, or how/when variables get shared. That
to me is the biggest problem with concurrency - people don't understand the
sharing that exists in their program.
Rule #1 for sharing mutable objects: Don't do it unless you have to.
What concurrent programming languages lack is a clear model for sharing,
where sharing is explicit. Some have tried variations of it (eg the
Eiffel/SCOOP 'seperate' notion) but it does get complex - requires escape
analysis etc. Ownership types cover some of the same space.
More information about the Concurrency-interest