[concurrency-interest] Fwd: dealing with people that questionvisibility problems

Peter Veentjer alarmnummer at gmail.com
Thu Feb 22 03:30:25 EST 2007


Hi Matthias,

thank you for your reply.

>>  At any rate: Spring's use of synchronized makes it also safe in 1.4.

Safe handoff is a feature that was added to Java 5. The behavior was
undefined in Java 1.4. Most cpu's have a strong memory coherence, so
changes will be visible, but no guarantees are made.

>
> > If objects are used in a multi threaded environment, you <b>have</b>
> > to make your objects thread safe.
>
> I do not agree here. I have to document how to use them in a thread-safe
> manner. With setter based injection that means to me: "Do not call
> setters after construction/publication except if explicitly allowed."

If you document that your object depends on being used in an
environment that provides safe handoff, you are doing concurrency
control :) You are controlling how your object should be used in a
multi-threaded environment.

> Matthias
>
> --
> matthias.ernst at coremedia.com
> software architect
> +49.40.32 55 87.503
>


More information about the Concurrency-interest mailing list