W dniu 2014-02-21 22:23, Daniel Naber pisze: > On 2014-02-21 21:35, Stefan Lotties wrote: > >> Actually I did change all those code to the double-locking technique >> because the IStemmer is not thread-safe. And I was pretty sure that >> there's no problem with the double-locking technique. Damn it! Well, >> now I know better. Thanks for hint. > > I'm still note sure if all the recent changes were needed... the > Wikipedia page says that double locking is broken only under Java <= > 1.4, and it points to > http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html > which claims that simply adding 'volatile' will make it work (on Java > 1.5 and later, which is the only thing we care about).
I don't think this changed much -- my changes are roughly equivalent to adding 'volatile'. But the crucial change was to add a lock (not a look, sorry for the typo) in BaseSynthesizer.lookup(). This stopped a wave of exceptions I got under JMeter. Then I run JMeter for half an hour, bombarding the server with series 50 queries, 5 per second, and I didn't see much of a problem. But I only tested several languages. Daniel, does the server still crash after my change? Regards, Marcin ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk _______________________________________________ Languagetool-devel mailing list Languagetool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/languagetool-devel