Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: multithreaded cache? Date: Tue, 15 May 2012 20:26:45 -0400 Organization: A noiseless patient Spider Lines: 28 Message-ID: References: <4fb224b2$0$6867$e4fe514c@news2.news.xs4all.nl> <4fb2e46c$0$6854$e4fe514c@news2.news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 16 May 2012 00:26:46 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="03ebLEozl+tXCe7JS60Feg"; logging-data="12679"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QlroSdwMoVSA2+AHYuArY" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: <4fb2e46c$0$6854$e4fe514c@news2.news.xs4all.nl> Cancel-Lock: sha1:Lb0g6WXmHTljgT3VZjLweTpQX1Y= Xref: csiph.com comp.lang.java.programmer:14558 On 5/15/2012 7:19 PM, Silvio Bierman wrote: > On 05/16/2012 12:57 AM, Roedy Green wrote: >> On Tue, 15 May 2012 11:41:06 +0200, Silvio Bierman >> wrote, quoted or indirectly quoted someone who said : >> >>> The simplest approach is to wrap your cached values in an object and >>> make all cache access go through two stages. >> >> Where did you learn this? > > Why do you ask? Do you disagree? > > It is something I came up with the first time I encountered the same > situation, probably many years ago. > It is obvious you need to decouple key lookups/insertions, which are > inherently cache-global, from value insertions/updates, which could be > considered key-local. > > Eric and Daniel responded with more specific solutions that both match > my general pattern. Three independent votes for one pattern: What we have here is a M A N D A T E !!! -- Eric Sosman esosman@ieee-dot-org.invalid