Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8393
| Date | 2011-09-28 17:39 -0700 |
|---|---|
| From | Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: NIO multiplexing + thread pooling |
| References | (1 earlier) <alpine.DEB.2.00.1109242028540.12593@urchin.earth.li> <9e8aqfFnorU1@mid.individual.net> <alpine.DEB.2.00.1109272044210.14737@urchin.earth.li> <9efsnrFoviU1@mid.individual.net> <j5vdvo$kon$1@dont-email.me> |
| Message-ID | <FL2dndua_qLJIx7TnZ2dnUVZ_vSdnZ2d@posted.palinacquisition> (permalink) |
On 9/28/11 8:20 AM, markspace wrote: > On 9/27/2011 11:21 PM, Robert Klemme wrote: >> >> Because you reduce synchronization overhead. If you have 1 or X threads >> doing the selecting and distributing the work over M >> X handler >> threads for N >> M channels then you have much higher potential for >> collisions than if you have X * (1 selector for M/X handler threads). > > <http://www.myfacewhen.net/uploads/954-not-sure-if-serious.jpg> > > Really? Is synchronization, relative to an app that's doing network IO, > a serious concern? I can't imagine that synchronization overhead is even > within a three orders of magnitude of the IO overhead. [...] I don't have specific numbers. But I can tell you that synchronization overhead, and in particular the cost of a thread context switch, is one of the reasons that i/o completion ports on Windows is such a critical technique for scalable networking processes. You still get context switches and thread synchronization with IOCP, but to a much smaller degree than if a program were structured differently (e.g. one dedicated thread per connection). Using IOCP, one generally has a limited number of IOCP threads (proportional to the number of CPU cores), and those threads are the only ones that handle actual i/o. Of course, this has direct implications only for Java running on Windows (and unfortunately, negative ones… there's nothing in the standard Java implementation for Windows that takes advantage of IOCP). But similar issues might exist on other platforms as well. Pete
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
NIO multiplexing + thread pooling Giovanni Azua <bravegag@hotmail.com> - 2011-09-24 20:32 +0200
Re: NIO multiplexing + thread pooling Tom Anderson <twic@urchin.earth.li> - 2011-09-24 20:46 +0100
Re: NIO multiplexing + thread pooling Giovanni Azua <bravegag@hotmail.com> - 2011-09-24 23:09 +0200
Re: NIO multiplexing + thread pooling Robert Klemme <shortcutter@googlemail.com> - 2011-09-25 11:33 +0200
Re: NIO multiplexing + thread pooling Tom Anderson <twic@urchin.earth.li> - 2011-09-27 20:52 +0100
Re: NIO multiplexing + thread pooling Robert Klemme <shortcutter@googlemail.com> - 2011-09-28 08:21 +0200
Re: NIO multiplexing + thread pooling markspace <-@.> - 2011-09-28 08:20 -0700
Re: NIO multiplexing + thread pooling Robert Klemme <shortcutter@googlemail.com> - 2011-09-28 18:56 +0200
Re: NIO multiplexing + thread pooling markspace <-@.> - 2011-09-28 11:07 -0700
Re: NIO multiplexing + thread pooling Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-28 17:39 -0700
Re: NIO multiplexing + thread pooling markspace <-@.> - 2011-09-29 09:25 -0700
Re: NIO multiplexing + thread pooling Lew <lewbloch@gmail.com> - 2011-09-30 07:46 -0700
Re: NIO multiplexing + thread pooling markspace <-@.> - 2011-09-30 08:22 -0700
Re: NIO multiplexing + thread pooling Lew <lewbloch@gmail.com> - 2011-09-30 08:30 -0700
Re: NIO multiplexing + thread pooling markspace <-@.> - 2011-09-30 08:49 -0700
Re: NIO multiplexing + thread pooling Robert Klemme <shortcutter@googlemail.com> - 2011-09-30 20:57 +0200
Re: NIO multiplexing + thread pooling "John B. Matthews" <nospam@nospam.invalid> - 2011-09-25 00:26 -0400
Re: NIO multiplexing + thread pooling Giovanni Azua <bravegag@hotmail.com> - 2011-09-25 11:13 +0200
csiph-web