[cas-dev] unnecessary syncing in DefaultTicketRegistryCleaner
March, Andres
amarch at soe.sony.com
Thu Feb 22 12:49:53 EST 2007
Thanks. My custom registry returns a new list from get tickets
currently. If creating that list gets to be expensive I suppose I'll
have to look at providing a thread safe iterator on the actual registry
contents.
- Andres
________________________________
From: cas-dev-bounces at tp.its.yale.edu
[mailto:cas-dev-bounces at tp.its.yale.edu] On Behalf Of Scott Battaglia
Sent: Wednesday, February 21, 2007 8:16 PM
To: Mailing list for CAS developers
Subject: Re: [cas-dev] unnecessary syncing in
DefaultTicketRegistryCleaner
I've actually removed that synchronization in the 3.1 release because I
realized the only thing doing the synchronization was the Cleaner (which
made the synchronized calls irrelevant).
As long as your getTickets method returns an instance of a Collections
class that is safe to iterate through while the registry is being
updated then you should be safe. In CAS 3.1 we ensure this in the
default registry by using the ConcurrentHashMap (who's iterator is
guaranteed to never throw a ConcurrentModificationException). I'll
probably add a note about that on the TicketRegistry interface.
-Scott
On 2/21/07, March, Andres <amarch at soe.sony.com> wrote:
I believe there is unnecessary synchronization in the
DefaultTicketRegistryCleaner. There are 2 places in clean() where
synchronization occurs but I think it should depend upon the ticket
registry for concurrency. In fact the two calls that clean() wraps:
getTickets() and deleteTickets() are synchronized in the
DefaultTicketRegistry. In my implementation of TicketRegistry, I use
BerkeleyDB and delegate to the db for concurrency matters. This extra
synchronization in the DefaultTicketRegistryCleaner leaves open more
possibility for Deadlocks. Thoughts?
Andres March
Platform - Application Engineering
Sony Online Entertainment
desk: 858.577.3373
cell: 619.519.1519
_______________________________________________
cas-dev mailing list
cas-dev at tp.its.yale.edu
http://tp.its.yale.edu/mailman/listinfo/cas-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas-dev/attachments/20070222/6e16280c/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 103 bytes
Desc: image001.gif
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20070222/6e16280c/attachment.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 73 bytes
Desc: image002.gif
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20070222/6e16280c/attachment-0001.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 73 bytes
Desc: image003.gif
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20070222/6e16280c/attachment-0002.gif
More information about the cas-dev
mailing list