Return-Path: Delivered-To: apmail-incubator-river-dev-archive@minotaur.apache.org Received: (qmail 69767 invoked from network); 15 Jul 2009 15:59:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jul 2009 15:59:33 -0000 Received: (qmail 66487 invoked by uid 500); 15 Jul 2009 15:59:42 -0000 Delivered-To: apmail-incubator-river-dev-archive@incubator.apache.org Received: (qmail 66456 invoked by uid 500); 15 Jul 2009 15:59:42 -0000 Mailing-List: contact river-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: river-dev@incubator.apache.org Delivered-To: mailing list river-dev@incubator.apache.org Received: (qmail 66446 invoked by uid 99); 15 Jul 2009 15:59:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2009 15:59:41 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.177] (HELO mail-vw0-f177.google.com) (209.85.212.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2009 15:59:31 +0000 Received: by vwj7 with SMTP id 7so2952184vwj.32 for ; Wed, 15 Jul 2009 08:59:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.100.1 with SMTP id w1mr11179974vcn.10.1247673549534; Wed, 15 Jul 2009 08:59:09 -0700 (PDT) X-Originating-IP: [65.116.132.250] In-Reply-To: <4A5CE6C6.4060709@wonderly.org> References: <4A4921FA.3030408@wonderly.org> <510143ac0907030226i22b4d6e9tf70857d357f115f4@mail.gmail.com> <30B045EF-D11D-4AB6-988E-3F97CAE8419B@gmail.com> <4A4EA0AD.4080807@zeus.net.au> <93890df00907031726k22aa0b50ib2306c2ef304c6ea@mail.gmail.com> <4A4EDD74.3010400@zeus.net.au> <93890df00907121605sbece8c8g1b2b3d9f8c603e8f@mail.gmail.com> <4A5CE6C6.4060709@wonderly.org> Date: Wed, 15 Jul 2009 11:59:09 -0400 Message-ID: Subject: Re: [Was: OSGi and Jini] Now -> Next Steps From: Peter Jones To: river-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Just to be clear, the "com.sun.jini.jeri.tcp.useNIO=3Dtrue" mode of the JERI TCP endpoint implementation still uses multiple threads to dispatch remote invocations-- RMI behavior would be drastically impacted if it only used a single thread for that (for reasons like you describe below). It just uses a single thread for performing I/O operations, at least those that "would block". -- Peter On Tue, Jul 14, 2009 at 4:12 PM, Gregg Wonderly wrote: > The Jini 2.0 software includes the ability to use NIO in the TCP endpoint= . > =A0This is activated by system property "com.sun.jini.jeri.tcp.useNIO". I= f you > look at TcpEndpoint and TcpServerEndpoint, you'll not find much different > going on. =A0The biggest issue with a typical network "distributed" syste= m, is > circular wait that can occur as systems "randomly" develop new connection= s > to other system. =A0Using a single thread to dispatch events in a server = for > "load handling" is not a good thing for any "work" that can have "externa= l" > contact. =A0So, the use of NIO for > "scalability" is find for things that don't end up interacting circularly= . > =A0For things that you have no idea how they will interact, it's better t= o > make sure that you have "new inbound call =3D=3D new inbound thread" so t= hat you > don't get into problems. =A0It may be that there is some work that you ca= n do > in a single thread, but that usually is something that a specific > application optimizes. > > One way to do that is to use inbound calls to "queue" work. =A0But then y= ou > need to use "callbacks" to notify the caller of the results of there > request, unless you design a very custom invocation layer that allows the > use of a "Future" or some other "signaling" mechanism to control when the > result is sent back to the caller. > > Gregg Wonderly >