[Geoserver-devel] Concurrency patch to CommonFactoryFinder

Hi all,

first off, sorry for cross posting.

the following is a patch for CommonFactoryFinder for which I'd like a review/comments/concerns/permission to commit: <http://pastebin.com/m3b046ebc&gt;

The thing is that on a geoserver WMS profiling session, the getFilterFactory method is used by every request and being synchronized makes the threads block unnecesarily.
Now, all the getXXX methods seem to be synchronized only for the getServiceRegistry() method they call, which seems to be better done if synchronizing only the block of getServiceRegistry() that instantiates the registry itself. But I might be missing something... comments?

Cheers,
Gabriel

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Gabriel Roldan ha scritto:

Hi all,

first off, sorry for cross posting.

the following is a patch for CommonFactoryFinder for which I'd like a review/comments/concerns/permission to commit: <http://pastebin.com/m3b046ebc&gt;

The thing is that on a geoserver WMS profiling session, the getFilterFactory method is used by every request and being synchronized makes the threads block unnecesarily.
Now, all the getXXX methods seem to be synchronized only for the getServiceRegistry() method they call, which seems to be better done if synchronizing only the block of getServiceRegistry() that instantiates the registry itself. But I might be missing something... comments?

Made the same question time ago:
http://n2.nabble.com/Common-factory-finder-synchronization-and-caching-td1948914.html#a1948914

Long story short, SPI lookups are so involved that even just a scan through them mutates the state of the registry. Sigh...

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Made the same question time ago:
http://n2.nabble.com/Common-factory-finder-synchronization-and-caching-td1948914.html#a1948914

Long story short, SPI lookups are so involved that even just a scan through them mutates the state of the registry. Sigh...

Good stuff. Yet last Martin's suggestion of cacheing the result of the lookup whenever possible is good. And in this case it's just performed by the SimpleFeatureBuilder used to wrap a coverage as a Feature if I remember well, so a good fit.

Gonna see where exactly was it.

Thanks,
Gabriel

Cheers
Andrea

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.