[Mono-dev] Question about NetworkStream.BeginRead

gelin yan dynamicgl at gmail.com
Fri Mar 16 18:08:25 UTC 2012


On Sat, Mar 17, 2012 at 2:03 AM, pablosantosluac at terra.es <
pablosantosluac at terra.es> wrote:

> Ok: the problem is that I was wrapping the NetworkStream with a
> BufferedStream, and BufferedStream is not async in Mono, while it is
> async in .NET
>
> :(
>
>
>
> On 16/03/2012 16:57, pablosantosluac at terra.es wrote:
> > Hi,
> >
> > I'm working on some changes to make the TcpChannel work in async mode.
> >
> > Instead of changing all the reads and writes to async, I'm just
> > modifying the intial message status read to async, so instead of having
> > a pile of threads waiting for IO on the server (waiting for clients to
> > call or disconnect), there will be only as few threads as running
> methods.
> >
> > It works great on Windows even under huge load (I'm testing on a
> > 100-nodes cluster on EC2).
> >
> > But, now, trying on Linux simply fails because this call:
> >
> > networkStream.BeginRead(buffer, 0, 6, callback, null);
> >
> > where networkStream is System.Net.Sockets.NetworkStream
> >
> > locks.
> >
> > What it actually does is to block and then invoke the callback, but it
> > doesn't go through until the callback finishes, which I think is not the
> > desired behavior.
> >
> > I'm running:
> > Mono JIT compiler version 2.10.2 (tarball Mon Apr 18 15:12:52 UTC 2011)
> > Copyright (C) 2002-2011 Novell, Inc and Contributors.
> www.mono-project.com
> >     TLS:           __thread
> >     SIGSEGV:       altstack
> >     Notifications: epoll
> >     Architecture:  amd64
> >     Disabled:      none
> >     Misc:          debugger softdebug
> >     LLVM:          yes(2.9svn-mono)
> >     GC:            Included Boehm (with typed GC and Parallel Mark)
> >
> > It fails with older monos too.
> >
> > Obviously I'm doing something wrong.
> >
> > Is there a way I can fix it?
> >
> > Thanks,
> >
> > pablo
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>

Hi.. Is it possible to post some benchmarks for that once you fixed your
bugs.  I am interested in using async socket with mono on Linux..thx.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120317/0088c8d9/attachment.html>


More information about the Mono-devel-list mailing list