Re: [Jts-topo-suite-user] PreparedGeometry thread safety
Brought to you by:
dr_jts
From: Martin D. <mtn...@te...> - 2013-01-15 04:50:47
|
Thanks for this report. As you suggest, it seems like the simplest approach is to simply synchronize the build() method. Are you able to change this and try it out? I will commit this to SVN in the meantime. On 1/14/2013 12:16 PM, Shahak Nagiel wrote: > I saw another issue in our logs today: > > java.lang.NullPointerException > at > com.vividsolutions.jts.index.strtree.AbstractSTRtree.build(AbstractSTRtree.java:117) > at > com.vividsolutions.jts.index.strtree.AbstractSTRtree.query(AbstractSTRtree.java:255) > at com.vividsolutions.jts.index.strtree.STRtree.query(STRtree.java:218) > at > com.vividsolutions.jts.noding.MCIndexSegmentSetMutualIntersector.intersectChains(MCIndexSegmentSetMutualIntersector.intersectChains.java:100) > at > com.vividsolutions.jts.noding.MCIndexSegmentSetMutualIntersector.process(MCIndexSegmentSetMutualIntersector.intersectChains.java:89) > at > com.vividsolutions.jts.noding.FastSegmentSetIntersectionFinder.intersects(FastSegmentSetIntersectionFinder.java:77) > atcom.vividsolutions.jts.noding.FastSegmentSetIntersectionFinder.intersects(FastSegmentSetIntersectionFinder.java:72) > atcom.vividsolutions.jts.geom.prep.PreparedPolygonIntersects.intersects(PreparedPolygonIntersects.java:101) > atcom.vividsolutions.jts.geom.prep.PreparedPolygonIntersects.intersects(PreparedPolygonIntersects.java:65) > > Looking at the AbstractSTRtree.build() implementation, it looks like > the itemBoundables must have been null to trigger that exception. > Since build() can only be called once--but isn't guarded against such > in a multi-threaded fashion, it seems like the method can simply be > synchronized (or, optionally, some lower-level locking mechanism for > the built flag)? > > Thanks, > Shahak > > > > ------------------------------------------------------------------------ > *From:* Martin Davis <mtn...@gm... <mailto:mtn...@gm...>> > *To:* "Smiley, David W." <ds...@mi... <mailto:ds...@mi...>> > *Cc:* Shahak Nagiel <sn...@ya... <mailto:sn...@ya...>>; > "jts...@li... > <mailto:jts...@li...>" > <jts...@li... > <mailto:jts...@li...>> > *Sent:* Wednesday, December 26, 2012 10:00 PM > *Subject:* Re: [Jts-topo-suite-user] PreparedGeometry thread safety > > I have committed a changeset to make PreparedGeometry fully > thread-safe (I hope). They are essentially the same as David's patch, > but go a bit further in terms of simplifying and clarifying the code. > > Shahak, are you able to build from SVN and test these out? I don't > have any other way of adequately testing whether these fixes work > (since the issues only seem to occur under very high concurrency, and > I don't have a 32-core machine handy to test with 8^) Suggestions for > other ways of verification are welcome... > > Martin > > On Mon, Dec 24, 2012 at 6:51 AM, Smiley, David W. <ds...@mi... > <mailto:ds...@mi...>> wrote: > > I see Martin responded with pretty much what I was going to say. > I was hoping certain problematic methods would get marked as > deprecated as I did in my patch but alas, that didn't make it in :-( > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > > > _______________________________________________ > Jts-topo-suite-user mailing list > Jts...@li... > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user > > > No virus found in this message. > Checked by AVG - www.avg.com <http://www.avg.com> > Version: 2013.0.2805 / Virus Database: 2637/6000 - Release Date: 12/31/12 > Internal Virus Database is out of date. > |