Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #8402

Re: Blocking IO thread-per-connection model: possible to avoid polling?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Giovanni Azua <bravegag@hotmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Blocking IO thread-per-connection model: possible to avoid polling?
Date Thu, 29 Sep 2011 22:21:06 +0200
Lines 33
Message-ID <CAAA9FD2.7F2D%bravegag@hotmail.com> (permalink)
References <CAA6C4A3.7E8F%bravegag@hotmail.com> <Ub-dnbm5zeCRZh3TnZ2dnUVZ_oudnZ2d@posted.palinacquisition> <CAA7313E.7EB5%bravegag@hotmail.com> <k72dnUeUSKV1ZBzTnZ2dnUVZ_judnZ2d@posted.palinacquisition>
Mime-Version 1.0
Content-Type text/plain; charset="US-ASCII"
Content-Transfer-Encoding 7bit
X-Trace individual.net utJfE2WXhabrn1sXZK6SWAebzS+NUFvGXmGoAV+7asx/5xThkn
Cancel-Lock sha1:nlGsrrC/YQC6VZ8yxVln9QjoQco=
User-Agent Microsoft-Entourage/12.31.0.110725
Thread-Topic Blocking IO thread-per-connection model: possible to avoid polling?
Thread-Index Acx+5VEXlJD8rP+K7E+JSs/dOy8NXQ==
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8402

Show key headers only | View raw


Hi Peter,

On 9/27/11 6:29 PM, in article
<NpOeStPeAdM@NnOwSlPiAnMk.com> wrote:
> I agree that the documentation is not clear on this point.  However, it
> is a fundamental criteria for BSD sockets and any API inherited from
> them that sockets be thread-safe and full duplex.  Java sockets are the
> same.
> 
> You would not want to use the same InputStream simultaneously from
> multiple threads, nor the same OutputStream simultaneously from multiple
> threads, but reading from one thread and writing from another is fully
> supported.  The Java sockets API would be broken if it weren't.
> 
Thank you! Yes I found about full-duplex supported by Java Sockets after
researching a bit :)

I finished creating the remoting support for my project based on the
"one-thread-per-connection" model. Actually, in order to have a stable and
predictable middleware load we were strongly advised to write blocking
Clients (send request and wait for response) so things got real simple as
only one Thread per connection is needed in the Middleware side: read
request, block until it is processed, and send back response. A very tricky
part was to Unit tests the whole remoting solution .. sigh.

I will be doing the NIO version soon.

Best regards,
Giovanni 

PS: thank you all for the help on these questions ... your answers were
pretty enlightening.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar


Thread

Blocking IO thread-per-connection model: possible to avoid polling? Giovanni Azua <bravegag@hotmail.com> - 2011-09-27 00:09 +0200
  Re: Blocking IO thread-per-connection model: possible to avoid polling? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-26 15:22 -0700
    Re: Blocking IO thread-per-connection model: possible to avoid polling? Robert Klemme <shortcutter@googlemail.com> - 2011-09-27 07:49 +0200
    Re: Blocking IO thread-per-connection model: possible to avoid polling? Giovanni Azua <bravegag@hotmail.com> - 2011-09-27 07:52 +0200
      Re: Blocking IO thread-per-connection model: possible to avoid polling? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-09-27 09:29 -0700
        Re: Blocking IO thread-per-connection model: possible to avoid polling? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-09-27 10:23 -0700
        Re: Blocking IO thread-per-connection model: possible to avoid polling? Giovanni Azua <bravegag@hotmail.com> - 2011-09-29 22:21 +0200

csiph-web