lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allan, Brad (Wokingham)" <Brad.Al...@Fiserv.com>
Subject Re: RAMDirectory code - locking?
Date Tue, 19 Mar 2013 21:42:43 GMT
to confirm my question is related to how the locking is being done.
Thanks.

(Sent from my Blackberry device)
Brad Allan
Development Lead
Risk & Compliance
Fiserv
Office: +44 (0) 845 013 1137
Mobile: +44 (0) 7866 720024
Fax: +44 (0) 845 013 1010
www.fiserv.com

----- Original Message -----
From: Rob Cecil [mailto:rob.cecil@gmail.com]
Sent: Tuesday, March 19, 2013 05:16 PM
To: user@lucenenet.apache.org <user@lucenenet.apache.org>
Subject: Re: RAMDirectory code - locking?

I think the question is more about Lock(this) rather than
Lock(mySimpleObject), e.g.:

http://stackoverflow.com/questions/2319286/what-to-pass-to-the-lock-keyword


On Tue, Mar 19, 2013 at 4:38 PM, Anders Lybecker <anders@lybecker.com>wrote:

> Hi Brad,
>
> I'm not really sure what your question is?
>
> Is use of the C# Lock keyword safe in RamDirectory? Yes it is. Is it a
> performance issue? No, not really. It is common in multi-threaded code
>
> Regards,
> Anders Lybecker
>
>
> On Tue, Mar 19, 2013 at 6:22 PM, Allan, Brad (Wokingham) <
> Brad.Allan@fiserv.com> wrote:
>
> > There are a number of
> >
> > 'lock (this)'
> >
> > statements in the code?
> >
> >
> >
> > Just wanting to check this has been considered and was considered safe.
> >
> >
> >
> > I'm used to seeing the use of some sort of Locker object to do this.
> >
> >
> >
> > Public class Bla {
> >
> >          private static Object locker = new Object();
> >
> >
> >
> >          Public void someMethod() {
> >
> >                  Lock(locker) {
> >
> >                           //do some stuff!
> >
> >                  }
> >
> >          }
> > }
> >
> > Brad Allan
> > Development Lead
> > Risk & Compliance
> > Fiserv
> > Office: +44 (0) 845 013 1137
> > Mobile: +44 (0) 7866 720024
> > www.fiserv.com<http://www.fiserv.com/>
> >
> >
> > ________________________________
> >
> > CheckFree Solutions Limited (trading as Fiserv)
> > Registered Office: Eversheds House, 70 Great Bridgewater Street,
> > Manchester, M15 ES
> > Registered in England: No. 2694333
> >
>

________________________________

CheckFree Solutions Limited (trading as Fiserv)
Registered Office: Eversheds House, 70 Great Bridgewater Street, Manchester, M15 ES
Registered in England: No. 2694333

Mime
View raw message