Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Recommendations for Lightweight Threading? Date: Sat, 16 Jun 2012 14:39:11 +0200 Lines: 25 Message-ID: References: <4fdc1941$0$86808$742ec2ed@news.sonic.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net tjn5YpDRKH6wNEmIkWQR9Qor3lF3i1eOE0ejEKLiJDx8K/C2Z7AgCKN8XgJSbyNc4= Cancel-Lock: sha1:3gzxrnXR502D8mpS92Tp2ujTbeo= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: <4fdc1941$0$86808$742ec2ed@news.sonic.net> Xref: csiph.com comp.lang.java.programmer:15329 On 16.06.2012 07:27, Kevin McMurtrie wrote: > It's possible to roll your own concurrency classes using compare-and-set > or safe races. Custom code with reduced functionality can beat the > general JVM classes by a lot. That sounds interesting: please share concrete examples where you were able to beat std lib "by a lot". > Minimizing thread interaction in high-performance code helps even more. > Writing to shared memory results in a hardware stall to sync CPU caches. > The bigger the system, the worse those cache syncs are. Well, that's one of the basic principles Doug Lea calls "thread confinement". Not sharing is always more efficient than sharing when it comes to multiple threads. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/