On 27/10/2008, De Groot, Cees <[EMAIL PROTECTED]> wrote: > Hi, > > We're using HC in order to access an internal high-volume service > (thousands reqs/sec), and we noticed that DefaultHttpParams is > synchronized all over the place. This kills concurrency (I have a thread > dump showing ~1200 threads waiting there ;-)), and I don't think it is > necessary - it should be possible to read settings without having to > acquire locks first.
That's not necessarily true. Synchronize does more than provide mutual exclusion - i.e. locking - it also ensures that fields written in one thread are correctly seen in another. Without synch. there is no guarantee that reader threads will see the latest value written to a variable, as the JVM is free to cache variables locally. The synch. forces a memory flush (for writers) and memory refetch (for readers). > We found some references to this issue on the Net, but none on this > mailing list. Is this a known issue? Is this something that needs > fixing? > > Thanks, > > Cees de Groot > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
