commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: [jcs] Ceanup and reorganize the project, was:Re: [VETO] Re: [jcs] What's next?
Date Tue, 27 May 2014 19:13:05 GMT
On 26.05.14 22:05, Romain Manni-Bucau wrote:
> the point is putIfAbsent is costly but globally once (can be done
> concurrently but this is ignorable at runtime). Only important thing is to
> ensure then the system uses a single instance.

Right, but what if the instance creates a file, socket or similar? If we
want to do this we need to postpone all costly initialization into an
initialize() method. In any case, I think this could simplified a lot by
removing all separate managers.

> The other point shocking me a bit is you need everything needs to be
> processed sequentially. For a cache you globally want the last value. So
> then you slow down the process cause you were not preempted.

I'm open to suggestions on how to solve this. Feel free to experiment
with JCSConcurrentCacheAccessUnitTest to see the effects. A put *must*
be finished before the cached object can be accessed.

> I globally get the idea and we could use a LockFactory + ReentrantLock to
> replace synchronized (would already be faster), this way we could even get
> a NoLockFactory ;).

I like the idea. It's certainly worth a try. My tests with locks did not
show much improvement, though.

Bye, Thomas.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message