Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: NIO multiplexing + thread pooling Date: Fri, 30 Sep 2011 20:57:43 +0200 Lines: 20 Message-ID: <4E861127.9070109@googlemail.com> References: <9e8aqfFnorU1@mid.individual.net> <9efsnrFoviU1@mid.individual.net> <2026012.1217.1317394005581.JavaMail.geo-discussion-forums@prfc6> <5746278.1755.1317396632057.JavaMail.geo-discussion-forums@prec11> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net xY3I4WInu2rOMnInakIHyQ5FdkzpH86sMJwXNpW4EhQAtCv9g= Cancel-Lock: sha1:vsbvlGw5GJmMBF2jTOgbM8MfD3Y= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8424 On 09/30/2011 05:49 PM, markspace wrote: > On 9/30/2011 8:30 AM, Lew wrote: >> markspace wrote: >>> Not all multi-threading requires context switching either. >> >> Huh? > > Imagine a situation where the number of threads is matched to the number > of CPUs. No need to switch out a context there (though it might happen > anyway, there isn't a *need*). Just pass data back and forth. Memory > barriers (happens-before in Java) is all you need in this case. That sounds fairly theoretical. On one hand a system typically has more processes (let alone threads) than cores. On the other hand even if the number of cores is large enough you will have management overhead through the OS's scheduler. Kind regards robert