Re: Thread-safety in Guard

2007-11-05 Thread Tim Peierls
On 11/4/07, Jerome Louvel [EMAIL PROTECTED] wrote: I've fixed the remaining Guard.secrets issue following Tim advises: - removed the setSecrets() method in trunk - eagerly instantiate the secrets map I've also fixed potential issues with RouteList using an underlying

RE: Thread-safety in Guard

2007-11-05 Thread Jerome Louvel
@restlet.tigris.org Objet : Re: Thread-safety in Guard On 11/4/07, Jerome Louvel [EMAIL PROTECTED] wrote: I've fixed the remaining Guard.secrets issue following Tim advises: - removed the setSecrets() method in trunk - eagerly instantiate the secrets map I've

Re: Thread-safety in Guard

2007-11-04 Thread Jerome Louvel
Hi all, I've fixed the remaining Guard.secrets issue following Tim advises: - removed the setSecrets() method in trunk - eagerly instantiate the secrets map I've also fixed potential issues with RouteList using an underlying CopyOnWriteArrayList instance. If you see remaining threading

RE: Thread-safety in Guard

2007-10-11 Thread Jerome Louvel
Hi Tim, What's the best way for me (or anyone else) to report other concurrency and documentation issues that I encounter? In this discussion group? This thread? Or somewhere else? For issues similar to the one we discussed, the best place is in the issue, via the comments system. I've

Re: Thread-safety in Guard

2007-10-09 Thread Tim Peierls
On 10/9/07, Jerome Louvel [EMAIL PROTECTED] wrote: Good idea, I've entered a RFE for this documentation task: http://restlet.tigris.org/issues/show_bug.cgi?id=369 What's the best way for me (or anyone else) to report other concurrency and documentation issues that I encounter? In this

Re: Thread-safety in Guard

2007-10-08 Thread Sean Landis
Funny you should ask! I can highly recommend Java Concurrency in Practice by Brian Goetz, Josh Bloch, Joe Bowbeer, David Holmes, Doug Lea, and me (Tim Peierls). My recommendation is probably biased by the fact that I helped write it, but we've had a lot of good feedback. --tim It is a great

RE: Thread-safety in Guard

2007-10-07 Thread Jerome Louvel
?id=368 Best regards, Jerome -Message d'origine- De : John D. Mitchell [mailto:[EMAIL PROTECTED] Envoyé : dimanche 7 octobre 2007 01:30 À : discuss@restlet.tigris.org Objet : Re: Thread-safety in Guard Hey Tim! On 10/6/07, Tim Peierls [EMAIL PROTECTED] wrote: [...] I do

RE: Thread-safety in Guard

2007-10-06 Thread Jerome Louvel
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Tim Peierls Envoyé : jeudi 4 octobre 2007 07:16 À : discuss@restlet.tigris.org Objet : Thread-safety in Guard There is a serious thread-safety problem in org.restlet.Guard (Restlet 1.0.5). The secrets field is lazily initialized

Re: Thread-safety in Guard

2007-10-06 Thread Tim Peierls
On 10/6/07, Jerome Louvel [EMAIL PROTECTED] wrote: I have made the following changes to Guard in SVN 1.0 branch: - secrets is now a ConcurrentHashMap instance - getSecrets() lazily instantiates the secrets field in a synchronized block: Unfortunately, unless *all* access to the secrets

Re: Thread-safety in Guard

2007-10-06 Thread Rob Heittman
, 2007 2:53:41 PM (GMT-0500) America/New_York Subject: Re: Thread-safety in Guard On 10/6/07, Jerome Louvel [EMAIL PROTECTED] wrote: I have made the following changes to Guard in SVN 1.0 branch: - secrets is now a ConcurrentHashMap instance - getSecrets() lazily instantiates the secrets field

Re: Thread-safety in Guard

2007-10-06 Thread Tim Peierls
On 10/6/07, Rob Heittman [EMAIL PROTECTED] wrote: Very interesting reference about the double checked locking idiom. I was unaware of the problems, and had actually read some of the papers advocating it. I do a lot of multithreaded Java work in critical environments, and probably need a

Re: Thread-safety in Guard

2007-10-06 Thread John D. Mitchell
Hey Tim! On 10/6/07, Tim Peierls [EMAIL PROTECTED] wrote: [...] I do a lot of multithreaded Java work in critical environments, and probably need a refresher on these issues. Can you recommend any good books or online resources that may debunk other conventional thread-safety wisdom in

Thread-safety in Guard

2007-10-03 Thread Tim Peierls
There is a serious thread-safety problem in org.restlet.Guard (Restlet 1.0.5). The secrets field is lazily initialized without proper synchronization and the TreeMap used to initialize it is not thread-safehttp://java.sun.com/javase/6/docs/api/java/util/TreeMap.html. The simplest fix would be to