Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8356
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.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 | Tue, 27 Sep 2011 07:52:30 +0200 |
| Lines | 30 |
| Message-ID | <CAA7313E.7EB5%bravegag@hotmail.com> (permalink) |
| References | <CAA6C4A3.7E8F%bravegag@hotmail.com> <Ub-dnbm5zeCRZh3TnZ2dnUVZ_oudnZ2d@posted.palinacquisition> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="US-ASCII" |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net CeE/ETcHcehWmuBD7rtclA/jRmr8x0uPzvhhcMydMARBpa9iJn |
| Cancel-Lock | sha1:1EY4u0dJar2ZJWPt+jN1cEUt2nk= |
| User-Agent | Microsoft-Entourage/12.31.0.110725 |
| Thread-Topic | Blocking IO thread-per-connection model: possible to avoid polling? |
| Thread-Index | Acx82aS1KiHHfdT3VE+85xXCMhNo3g== |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8356 |
Show key headers only | View raw
Hello Pete, Please note I am using classic Socket and Blocking IO and not NIO. On 9/27/11 12:22 AM, in article <NpOeStPeAdM@NnOwSlPiAnMk.com> wrote: > > Why do you need to interrupt the thread in order to send data? You > should be able to just get the output stream from the socket when you > create it, and then use that any time you want to send data. > Any time I want? Even if it means to write to the OutputStream from a different thread than the one receiving data? It is not clear from the documentation I can do this safely on a Socket. I think is not possible unless I get the underlying SocketChannel or? > The thread that reads from the socket shouldn't need to be responsible > for sending at all (except possibly as an optimization in the case where > it knows right away it has something to send as a response to something > it's just read). > I would not like to have my "Worker Threads" IO bound in any way, I would not prefer to have them responsible for sending data. The other idea is two have two-threads-per-connection model, one for receiving and one for sending ... but this is not the model I was trying to implement in my OP. TIA, Best regards, Giovanni
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
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