-
1. Re: PagingManagerImpl::getPageStore
clebert.suconic Nov 13, 2008 10:31 PM (in response to clebert.suconic)I made several tests around this method...
you could have eventually few instances created and imediatly destroyed during an initial ramp up, but after the initial load... and the ConcurrentHashMap aways gave enough protection on the Store.
Well... But anyway I have created a new method synchronized createPageStore on the Chunk Branch which is aways used in places where I don't need concurrent calls over the same store. When we create the queue now, the pageStore will be also created. -
2. Re: PagingManagerImpl::getPageStore
timfox Nov 17, 2008 4:14 AM (in response to clebert.suconic)One problem with that code is that in case of race start() will be called on the old store even if it's already started, i.e. it should read:
-
3. Re: PagingManagerImpl::getPageStore
clebert.suconic Nov 17, 2008 3:15 PM (in response to clebert.suconic)"timfox" wrote:
One problem with that code is that in case of race start() will be called on the old store even if it's already started, i.e. it should read:
start is synchronized, and it will return immediately if already started.
But that won't happen after my merge from chunk. All the stores are either started when the server is started, or when the queue is created. -
4. Re: PagingManagerImpl::getPageStore
timfox Nov 20, 2008 1:13 PM (in response to clebert.suconic)Another reason why it is not threadsafe:
store = newStore(storeName);
With a race you could get two stores being created, and one throw away. When the store is created it creates files on disk. So you'd get two lots of dirs created on disk with the same name which would fail. -
5. Re: PagingManagerImpl::getPageStore
clebert.suconic Nov 20, 2008 1:30 PM (in response to clebert.suconic)Well.. that is a problem I agree.
The directory creation was supposed to be done inside the start.
And start should be synchronized (as it is) making all the threads wait until this was done.