[cas-dev] unnecessary syncing in DefaultTicketRegistryCleaner
Scott Battaglia
scott.battaglia at gmail.com
Wed Feb 21 23:16:22 EST 2007
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/20070221/24b5ffc4/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.gif
Type: image/gif
Size: 103 bytes
Desc: not available
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20070221/24b5ffc4/attachment.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.gif
Type: image/gif
Size: 73 bytes
Desc: not available
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20070221/24b5ffc4/attachment-0001.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.gif
Type: image/gif
Size: 73 bytes
Desc: not available
Url : http://tp.its.yale.edu/pipermail/cas-dev/attachments/20070221/24b5ffc4/attachment-0002.gif
More information about the cas-dev
mailing list