The synchronized keyword is continuously optimized upon. I would highly
recommend that you keep thinks simple.

My advise would be: use synchronized unless you can prove (by a
benchmark) that the use of a ReentrantLock speeds things up considerably.

With concurrent programming the priority must be the make it right. (and
it is not small achievement!)  Then if the profiler shows that a
particular lock is a bottleneck, you'll make some change.

I've read somewhere an advise that said that you should try to be clever
when thinking about synchronization issues.

Anyway before optimizing anything you should make explicit the
concurrency relations between objects (see  DIRMINA-364)

http://issues.apache.org/jira/browse/DIRMINA-364

_________________________________________________________________
Find dine dokumenter lettere med MSN Toolbar med Windows-pc-søgning: http://toolbar.msn.dk

Reply via email to