F# has a programming model for async that blows C# right out of the water. See e.g.

[link:lorgonblog.spaces.live.com]

By on 5/5/2010 3:26 PM ()

Thanks Brian Ill check that out.

I actually have a pretty good implementation in C# using the AsyncEventArgs model that Microsoft introduced with .Net 3.0 it would be interesting to see what can be done in F#...

By on 5/5/2010 3:44 PM ()

Wow, I guess you are talking about

[link:msdn.microsoft.com]

? I used to work on the WCF team, and I had never heard of that until now. Sounds like it's about as close to the metal as you can get in managed code. I am unclear that that kind of memory performance matters (I would guess that other factors will dominate today), but interesting, I had no clue that stuff existed.

By on 5/5/2010 4:25 PM ()

I came across the extra functionality when .Net 2.0 sp1 came out, I noticed much better performance when using it compared to the old IAsync method, I think its easier to follow to when you look back on the code a few months later.

Ill have to get a little bit more up to speed on F# then see if I can get a similar version built. The benefits are mainly due to the fact that there are no longer objects created for each send and receive. Once you have a high throughput server you would defiantly feel the benefits. I suppose it goes slightly against the Functional programming mantra in that the buffer part of the SocketAsyncEventArgs is mutable to allow buffer reassignment to a contiguous block of memory to further increase the performance...

By on 5/8/2010 8:45 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper