Very interesting, thanks for the feedback! Let me see whether I got it:
1. All statements below refer to Java 1.5.
2. fieldX = new SomeType(zzz)
- This is thread-safe if SomeType is immutable. An immutable object
features:
- unmodifiable state
- all fields are final and all fields hold immuta
Connor, Brett (LNG-TWY) wrote:
> But there a situation where one thread can be using one locator factory and
> another thread using a different one isn't there?
correct, but AFAIU that's not an issue in this case. the locator factory does
not have to be a singleton in a strict sense.
regards
mar
Marcel wrote:
>
> Marc Speck wrote:
> > Actually, this internal field is the source of a potential data race:
> > thread A runs up to the point, when it has constructed
> > LocatorFactoryImplEx but has not yet assigned the internal field.
> > Thread A gets on hold relative to thread B. B runs t
Marc wrote:
>
> Hi Felix
>
> > I am neither an export on any Memory Model issue, but I always
thought
> > that the construct
> >
> > fieldX = new SomeType(zzz);
> >
> > would be ok, because fieldX would only be set after the SomeType
> > instance has properly been setup and ready for use.
>
Marc Speck wrote:
> Actually, this internal field is the source of a potential data race: thread
> A runs up to the point, when it has constructed LocatorFactoryImplEx but has
> not yet assigned the internal field. Thread A gets on hold relative to
> thread B. B runs through the getter and sees tha
Hi Felix
> I am neither an export on any Memory Model issue, but I always thought
> that the construct
>
> fieldX = new SomeType(zzz);
>
> would be ok, because fieldX would only be set after the SomeType
> instance has properly been setup and ready for use.
I would have thought the same if
Hi Marc,
You are getting me on my left foot ;-)
I am neither an export on any Memory Model issue, but I always thought
that the construct
fieldX = new SomeType(zzz);
would be ok, because fieldX would only be set after the SomeType
instance has properly been setup and ready for use.
Have y
Thanks for the replies, Alex and Felix.
> The original author is
> currently on vacation, maybe she can answer you later.
>
Sure, I've just done the same.
Before giving my reply, I want to emphasize that I'm on thin ice when
talking about memory model in Java 1.5 let alone 1.4 that Jackrabbit
r
Hi Marc,
Marc Speck schrieb:
> Ok, everybody seems to silently agree that there is no threading issue with
> this servlet method:
>
> public DavLocatorFactory getLocatorFactory() {
> if (locatorFactory == null) {
> locatorFactory = new LocatorFactoryImplEx(resourcePathPrefix);
> }
Factory = new LocatorFactoryImplEx(resourcePathPrefix);
>}
>return locatorFactory;
> }
>
>
> I just ask why this is thread safe. It is not called in servlet.init() or
> the like, isn't it?
> Thanks,
> Marc
>
>
>
>
> On Tue, Sep 2, 2008 at 8:55 AM, Marc Speck
why this is thread safe. It is not called in servlet.init() or
the like, isn't it?
Thanks,
Marc
On Tue, Sep 2, 2008 at 8:55 AM, Marc Speck <[EMAIL PROTECTED]> wrote:
>
> While extending SimpleWebDavServlet, I could not see at first glance how
getLocatorFactory() (
http://fishe
While extending SimpleWebDavServlet, I could not see at first glance
how getLocatorFactory()
(
http://fisheye6.atlassian.com/browse/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/SimpleWebdavServlet.java?r=603178#l204)
is called the first time (for lazy
12 matches
Mail list logo