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?

From Giovanni Azua <bravegag@hotmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Blocking IO thread-per-connection model: possible to avoid polling?
Date 2011-09-29 22:21 +0200
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>

Show all headers | 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