cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Continuation invalidation strategy
Date Tue, 10 May 2005 13:57:53 GMT
Vadim Gritsenko wrote:
> Leszek Gawron wrote:
> 
>> Vadim Gritsenko wrote:
>>
>>> If you want to tinker with ContinuationsManagerImpl, take a look at:
>>>   http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=111323704203839
>>
>>
>> Strange I missed that post ..
>>
>>
>>> Unsynchronized access to WebContinuationsHolder from 
>>> invalidateContinuations() simultaneously with write access in 
>>> generateContinuation() should reliably cause 
>>> ConcurrentModificationException.
>>
>>
>> I do not quite get the problem. Doesn't it cause 
>> ConcurrentModificationException now?
> 
> 
> It should - I've not seen it though.
> 
> 
>> Other thing is how can invalidateContinuations and 
>> generateContinuation be run concurrently. invalidateContinuations is 
>> invoked only for expired sessions - how can new continuation be 
>> generated for that session?
> 
> 
> Bad example then. Here is better one:
> 
>   invalidateContinuations() gets Iterator on continuationsHolder.holder 
> map.
>   invalidateContinuations() calls _invalidate()
>   _invalidate() calls disposeContinuation()
>   disposeContinuation() modifies continuationsHolder.holder map.
> 
> After that,
> 
>   invalidateContinuations() calls next() and causes 
> ConcurrentModificationException.
> 
> Seems to me invalidateContinuations() should have while(!empty) loop 
> instead of iterator.
Still HashMap has no interface other than iterator to get it's contents.
you can either iterate through hashMap.iterator() or 
hashMap().keySet().iterator() - no difference, both are synced.

any ideas?

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message