SocketChannel bidirectional read/write

Sebastian Sickelmann sebastian.sickelmann at gmx.de
Mon Jan 16 03:05:20 PST 2012


Sorry. I missread hegewalds mail. I now think He really uses one thread for reading and oben for writing. I missinterpreted this.
-- 
Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.



Alan Bateman <Alan.Bateman at oracle.com> schrieb:

On 16/01/2012 05:18, Sebastian Sickelmann wrote:
> Hi, i think it is because of the
> synchronized (writeLock) {
> and
> synchronized (readLock) {
>
> blocks.
>
> Maybe there is a way to improve this to some amount of lesser locking. 
> But i haven't looked into this topic.
>
> -- Sebastian
>
I don't think there is sufficient information in the original mail. This 
may be a case where the TCP receive window size should be increased as 
it may be limiting through-put. As regards the read and write locks - 
they are distinct locks and so shouldn't impact a concurrent reader and 
writer (and it wouldn't make sense to have concurrent readers or 
concurrent writers as SocketChannel is to a stream connection).

-Alan.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20120116/5dc0d3c9/attachment.html 


More information about the nio-discuss mailing list